/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-qingdao' = 'adb.aliyuncs.com',
    'cn-beijing' = 'adb.aliyuncs.com',
    'cn-hangzhou' = 'adb.aliyuncs.com',
    'cn-shanghai' = 'adb.aliyuncs.com',
    'cn-shenzhen' = 'adb.aliyuncs.com',
    'cn-hongkong' = 'adb.aliyuncs.com',
    'ap-southeast-1' = 'adb.aliyuncs.com',
    'us-west-1' = 'adb.aliyuncs.com',
    'us-east-1' = 'adb.aliyuncs.com',
    'cn-hangzhou-finance' = 'adb.aliyuncs.com',
    'cn-north-2-gov-1' = 'adb.aliyuncs.com',
    'ap-northeast-2-pop' = 'adb.ap-northeast-1.aliyuncs.com',
    'cn-beijing-finance-1' = 'adb.aliyuncs.com',
    'cn-beijing-finance-pop' = 'adb.aliyuncs.com',
    'cn-beijing-gov-1' = 'adb.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'adb.aliyuncs.com',
    'cn-edge-1' = 'adb.aliyuncs.com',
    'cn-fujian' = 'adb.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'adb.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'adb.aliyuncs.com',
    'cn-hangzhou-test-306' = 'adb.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'adb.aliyuncs.com',
    'cn-qingdao-nebula' = 'adb.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'adb.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'adb.aliyuncs.com',
    'cn-shanghai-finance-1' = 'adb.aliyuncs.com',
    'cn-shanghai-inner' = 'adb.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'adb.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'adb.aliyuncs.com',
    'cn-shenzhen-inner' = 'adb.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'adb.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'adb.aliyuncs.com',
    'cn-wuhan' = 'adb.aliyuncs.com',
    'cn-yushanfang' = 'adb.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'adb.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'adb.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'adb.aliyuncs.com',
    'eu-west-1-oxs' = 'adb.ap-northeast-1.aliyuncs.com',
    'me-east-1' = 'adb.ap-northeast-1.aliyuncs.com',
    'rus-west-1-pop' = 'adb.ap-northeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('adb', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model Adb4MysqlSparkDiagnosisInfo {
  diagnosisCode?: string(name='DiagnosisCode'),
  diagnosisCodeLabel?: string(name='DiagnosisCodeLabel'),
  diagnosisMsg?: string(name='DiagnosisMsg'),
  diagnosisType?: string(name='DiagnosisType', example='APPLICATION'),
}

model ColDetailModel {
  columnName?: string(name='ColumnName'),
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  distributeKey?: boolean(name='DistributeKey'),
  nullable?: boolean(name='Nullable'),
  partitionKey?: boolean(name='PartitionKey'),
  primaryKey?: boolean(name='PrimaryKey'),
  schemaName?: string(name='SchemaName'),
  tableName?: string(name='TableName'),
  type?: string(name='Type'),
  updateTime?: string(name='UpdateTime'),
}

model CstoreIndexModel {
  columnOrds?: [ string ](name='ColumnOrds'),
  createTime?: string(name='CreateTime'),
  databaseName?: string(name='DatabaseName'),
  indexColumns?: [
    FieldSchemaModel
  ](name='IndexColumns'),
  indexName?: string(name='IndexName'),
  indexType?: string(name='IndexType'),
  options?: map[string]string(name='Options'),
  physicalTableName?: string(name='PhysicalTableName'),
  updateTime?: string(name='UpdateTime'),
}

model DatabaseSummaryModel {
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  owner?: string(name='Owner'),
  schemaName?: string(name='SchemaName'),
  updateTime?: string(name='UpdateTime'),
}

model Detail {
  appType?: string(name='AppType', example='BATCH'),
  DBClusterId?: string(name='DBClusterId', example='amv-bp11q28kv****'),
  data?: string(name='Data', example='{     "name": "SparkPi",     "file": "local:///tmp/spark-examples.jar",     "className": "org.apache.spark.examples.SparkPi",     "args": [         "1000000"     ],     "conf": {         "spark.driver.resourceSpec": "small",         "spark.executor.instances": 1,         "spark.executor.resourceSpec": "small"     } }'),
  durationInMillis?: long(name='DurationInMillis', example='100'),
  estimateExecutionCpuTimeInSeconds?: long(name='EstimateExecutionCpuTimeInSeconds', example='100'),
  lastAttemptId?: string(name='LastAttemptId', example='s202204291426hzpre60cfa*****-0003'),
  lastUpdatedTimeInMillis?: long(name='LastUpdatedTimeInMillis', example='1651213645200'),
  logRootPath?: string(name='LogRootPath', example='oss://<bucket-name>/logs/driver'),
  resourceGroupName?: string(name='ResourceGroupName', example='spark-rg'),
  startedTimeInMillis?: long(name='StartedTimeInMillis', example='1651213645010'),
  submittedTimeInMillis?: long(name='SubmittedTimeInMillis', example='1651213645000'),
  terminatedTimeInMillis?: long(name='TerminatedTimeInMillis', example='1651213645300'),
  webUiAddress?: string(name='WebUiAddress', example='https://sparkui.aliyuncs.com/token=xxx'),
}

model FieldSchemaModel {
  autoIncrement?: boolean(name='AutoIncrement'),
  columnRawName?: string(name='ColumnRawName'),
  comment?: string(name='Comment'),
  compressFloatUseShort?: boolean(name='CompressFloatUseShort'),
  compression?: string(name='Compression'),
  createTime?: string(name='CreateTime'),
  dataType?: string(name='DataType'),
  databaseName?: string(name='DatabaseName'),
  defaultValue?: string(name='DefaultValue'),
  delimiter?: string(name='Delimiter'),
  encode?: string(name='Encode'),
  isPartitionKey?: boolean(name='IsPartitionKey'),
  mappedName?: string(name='MappedName'),
  name?: string(name='Name'),
  nullable?: boolean(name='Nullable'),
  onUpdate?: string(name='OnUpdate'),
  ordinalPosition?: long(name='OrdinalPosition'),
  physicalColumnName?: string(name='PhysicalColumnName'),
  pkPosition?: long(name='PkPosition'),
  precision?: long(name='Precision'),
  primarykey?: boolean(name='Primarykey'),
  scale?: long(name='Scale'),
  tableName?: string(name='TableName'),
  tokenizer?: string(name='Tokenizer'),
  type?: string(name='Type'),
  updateTime?: string(name='UpdateTime'),
  valueType?: string(name='ValueType'),
}

model Filters {
  appIdRegex?: string(name='AppIdRegex'),
  appNameRegex?: string(name='AppNameRegex'),
  appState?: string(name='AppState'),
  appType?: string(name='AppType'),
  executionTimeRange?: {
    maxTimeInSeconds?: long(name='MaxTimeInSeconds'),
    minTimeInSeconds?: long(name='MinTimeInSeconds'),
  }(name='ExecutionTimeRange'),
  submitTimeRange?: {
    maxTimeInMills?: long(name='MaxTimeInMills'),
    minTimeInMills?: long(name='MinTimeInMills'),
  }(name='SubmitTimeRange'),
  termiatedTimeRange?: {
    maxTimeInMills?: long(name='MaxTimeInMills'),
    minTimeInMills?: long(name='MinTimeInMills'),
  }(name='TermiatedTimeRange'),
}

model LogAnalyzeResult {
  appErrorAdvice?: string(name='AppErrorAdvice'),
  appErrorCode?: string(name='AppErrorCode', example='EXCEEDED_QUOTA'),
  appErrorLog?: string(name='AppErrorLog', example='exception: xxxx'),
}

model OperatorNode {
  children?: [
    OperatorNode
  ](name='children'),
  id?: int32(name='id'),
  levelWidth?: int32(name='levelWidth'),
  nodeDepth?: int32(name='nodeDepth'),
  nodeName?: string(name='nodeName'),
  nodeWidth?: int32(name='nodeWidth'),
  parentId?: int32(name='parentId'),
  stats?: {
    bytes?: long(name='bytes'),
    outputRows?: long(name='outputRows'),
    parameters?: string(name='parameters'),
    peakMemory?: long(name='peakMemory'),
    timeCost?: long(name='timeCost'),
  }(name='stats'),
}

model SerDeInfoModel {
  name?: string(name='Name'),
  parameters?: map[string]string(name='Parameters'),
  serDeId?: long(name='SerDeId'),
  serializationLib?: string(name='SerializationLib'),
}

model SparkAnalyzeLogTask {
  DBClusterId?: string(name='DBClusterId', example='amv-adbxxxxx'),
  result?: LogAnalyzeResult(name='Result'),
  ruleMatched?: boolean(name='RuleMatched', example='true'),
  startedTimeInMillis?: long(name='StartedTimeInMillis', example='1672123543000'),
  submittedTimeInMillis?: long(name='SubmittedTimeInMillis', example='1672123543000'),
  taskErrMsg?: string(name='TaskErrMsg', example='Driver log not found'),
  taskId?: long(name='TaskId', example='10'),
  taskState?: string(name='TaskState', example='WAITING'),
  terminatedTimeInMillis?: long(name='TerminatedTimeInMillis', example='1672123543000'),
  userId?: long(name='UserId', example='13719918xxx'),
}

model SparkAppInfo {
  appId?: string(name='AppId', example='s202207151211hz0cb4*****'),
  appName?: string(name='AppName', example='Spark Test'),
  DBClusterId?: string(name='DBClusterId', example='amv-23xxxx'),
  detail?: Detail(name='Detail'),
  message?: string(name='Message', example='WARN: Disk is full'),
  priority?: string(name='Priority', example='NORMAL'),
  state?: string(name='State', example='FAILED'),
}

model SparkAttemptInfo {
  attemptId?: string(name='AttemptId', example='s202207151211hz0cb4200*****-0001'),
  detail?: Detail(name='Detail'),
  message?: string(name='Message', example='WARN: Disk is full'),
  priority?: string(name='Priority', example='NORMAL'),
  state?: string(name='State', example='RUNNING'),
}

model SparkBatchSQL {
  DBClusterId?: string(name='DBClusterId', example='amv-xxx'),
  errMessage?: string(name='ErrMessage', example='schema is not found'),
  query?: string(name='Query', example='query'),
  queryEndTime?: long(name='QueryEndTime', example='1723521767000'),
  queryId?: string(name='QueryId', example='amv-202401-xx'),
  queryStartTime?: long(name='QueryStartTime', example='1723521767000'),
  queryState?: string(name='QueryState', example='RUNNING'),
  querySubmissionTime?: long(name='QuerySubmissionTime', example='1723521767000'),
  resourceGroupName?: string(name='ResourceGroupName', example='spark_rg'),
  schema?: string(name='Schema', example='default'),
  statements?: [
    SparkBatchSQLStatement
  ](name='Statements'),
  uid?: long(name='Uid', example='12222222'),
}

model SparkBatchSQLStatement {
  appId?: string(name='AppId', example='s20240122jsdx****'),
  code?: string(name='Code', example='SELECT 100'),
  endTime?: long(name='EndTime', example='1723521767000'),
  error?: string(name='Error', example='table is not found'),
  result?: string(name='Result', example='JSON格式执行结果集'),
  resultUri?: string(name='ResultUri', example='oss://yourbucket/result.json'),
  startTime?: long(name='StartTime', example='1723521767000'),
  state?: string(name='State', example='RUNNING'),
  statementId?: string(name='StatementId', example='amv-20240711-stmt'),
}

model SparkOperatorInfo {
  metricValue?: long(name='MetricValue'),
  operatorName?: bytes(name='OperatorName'),
}

model SparkSession {
  active?: string(name='Active', example='true'),
  aliyunUid?: long(name='AliyunUid', example='11123123'),
  sessionId?: long(name='SessionId', example='15'),
  state?: string(name='State', example='idle'),
}

model Statement {
  aliyunUid?: long(name='AliyunUid', example='1111111'),
  code?: string(name='Code', example='SELECT * FROM table'),
  codeState?: string(name='CodeState', example='Waiting'),
  codeType?: string(name='CodeType', example='SQL'),
  endTime?: long(name='EndTime', example='1658987911000'),
  error?: string(name='Error', example='Disk is full'),
  haveRows?: boolean(name='HaveRows', example='true'),
  output?: string(name='Output', example='Spark is running, the ouput is...'),
  resourceGroup?: string(name='ResourceGroup', example='rg1'),
  sessionId?: long(name='SessionId', example='10'),
  startTime?: long(name='StartTime', example='1658977911000'),
  statementId?: long(name='StatementId', example='100'),
  totalCount?: long(name='TotalCount', example='1000'),
}

model StatementInfo {
  code?: string(name='Code'),
  completedTimeInMills?: long(name='CompletedTimeInMills'),
  output?: string(name='Output'),
  process?: float(name='Process'),
  startedTimeInMills?: long(name='StartedTimeInMills'),
  state?: string(name='State'),
  statementId?: string(name='StatementId'),
}

model StorageDescriptorModel {
  compressed?: boolean(name='Compressed'),
  inputFormat?: string(name='InputFormat'),
  location?: string(name='Location'),
  numBuckets?: long(name='NumBuckets'),
  outputFormat?: string(name='OutputFormat'),
  parameters?: map[string]string(name='Parameters'),
  sdId?: long(name='SdId'),
  serDeInfo?: SerDeInfoModel(name='SerDeInfo'),
  storedAsSubDirectories?: boolean(name='StoredAsSubDirectories'),
}

model TableDetailModel {
  catalog?: string(name='Catalog'),
  columns?: [
    ColDetailModel
  ](name='Columns'),
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  owner?: string(name='Owner'),
  schemaName?: string(name='SchemaName'),
  tableName?: string(name='TableName'),
  tableType?: string(name='TableType'),
  updateTime?: string(name='UpdateTime'),
}

model TableModel {
  archiveType?: string(name='ArchiveType'),
  blockSize?: long(name='BlockSize'),
  bucket?: long(name='Bucket'),
  bucketCount?: long(name='BucketCount'),
  cols?: [
    FieldSchemaModel
  ](name='Cols'),
  comment?: string(name='Comment'),
  compression?: string(name='Compression'),
  createTime?: string(name='CreateTime'),
  currentVersion?: long(name='CurrentVersion'),
  dbName?: string(name='DbName'),
  dictEncode?: boolean(name='DictEncode'),
  distributeColumns?: [
    FieldSchemaModel
  ](name='DistributeColumns'),
  distributeType?: string(name='DistributeType'),
  enableDfs?: boolean(name='EnableDfs'),
  hotPartitionCount?: long(name='HotPartitionCount'),
  indexes?: [
    CstoreIndexModel
  ](name='Indexes'),
  isAllIndex?: boolean(name='IsAllIndex'),
  isFulltextDict?: boolean(name='IsFulltextDict'),
  maxColumnId?: long(name='MaxColumnId'),
  parameters?: map[string]string(name='Parameters'),
  partitionColumn?: string(name='PartitionColumn'),
  partitionCount?: long(name='PartitionCount'),
  partitionKeys?: [
    FieldSchemaModel
  ](name='PartitionKeys'),
  partitionType?: string(name='PartitionType'),
  physicalDatabaseName?: string(name='PhysicalDatabaseName'),
  physicalTableName?: string(name='PhysicalTableName'),
  previousVersion?: long(name='PreviousVersion'),
  rawTableName?: string(name='RawTableName'),
  routeColumns?: [
    FieldSchemaModel
  ](name='RouteColumns'),
  routeEffectiveColumn?: FieldSchemaModel(name='RouteEffectiveColumn'),
  routeType?: string(name='RouteType'),
  rtEngineType?: string(name='RtEngineType'),
  rtIndexAll?: boolean(name='RtIndexAll'),
  rtModeType?: string(name='RtModeType'),
  sd?: StorageDescriptorModel(name='Sd'),
  storagePolicy?: string(name='StoragePolicy'),
  subpartitionColumn?: string(name='SubpartitionColumn'),
  subpartitionCount?: long(name='SubpartitionCount'),
  subpartitionType?: string(name='SubpartitionType'),
  tableEngineName?: string(name='TableEngineName'),
  tableName?: string(name='TableName'),
  tableType?: string(name='TableType'),
  tblId?: long(name='TblId'),
  temporary?: boolean(name='Temporary'),
  updateTime?: string(name='UpdateTime'),
  viewExpandedText?: string(name='ViewExpandedText'),
  viewOriginalText?: string(name='ViewOriginalText'),
  viewSecurityMode?: string(name='ViewSecurityMode'),
}

model TableSummaryModel {
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  mvDetailModel?: OpenStructMvDetailModel(name='MvDetailModel'),
  owner?: string(name='Owner'),
  SQL?: string(name='SQL'),
  schemaName?: string(name='SchemaName'),
  tableName?: string(name='TableName'),
  tableSize?: long(name='TableSize'),
  tableType?: string(name='TableType'),
  updateTime?: string(name='UpdateTime'),
}

model OpenStructMVRecommendResultModel {
  acceleratedQueriesCount?: long(name='AcceleratedQueriesCount'),
  baseTables?: [
    OpenStructMvBaseTableDetailModel
  ](name='BaseTables'),
  savedScanbytes?: long(name='SavedScanbytes'),
  subquery?: string(name='Subquery'),
  subqueryId?: long(name='SubqueryId'),
  supportIncrementalRefresh?: boolean(name='SupportIncrementalRefresh'),
}

model OpenStructMvBaseTableDetailModel {
  dataVolumn?: string(name='DataVolumn'),
  enableBinlog?: boolean(name='EnableBinlog'),
  schemaName?: string(name='SchemaName'),
  tableName?: string(name='TableName'),
}

model OpenStructMvDetailModel {
  baseTableNames?: [[ string ]  ](name='BaseTableNames'),
  explicitHit?: long(name='ExplicitHit'),
  firstRefreshTime?: string(name='FirstRefreshTime'),
  implicitHit?: long(name='ImplicitHit'),
  isInactive?: boolean(name='IsInactive'),
  localSize?: long(name='LocalSize'),
  queryRewriteEnabled?: boolean(name='QueryRewriteEnabled'),
  refreshInterval?: string(name='RefreshInterval'),
  refreshState?: string(name='RefreshState'),
  remoteSize?: long(name='RemoteSize'),
  resourceGroup?: string(name='ResourceGroup'),
  updatedAt?: string(name='UpdatedAt'),
}

model OpenStructMvRecommendSubTaskModel {
  endTime?: string(name='EndTime'),
  scanQueriesCount?: long(name='ScanQueriesCount'),
  startTime?: string(name='StartTime'),
  status?: string(name='Status'),
  subQueriesCount?: long(name='SubQueriesCount'),
  subtaskId?: long(name='SubtaskId'),
}

model OpenStructMvRecommendTaskModel {
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  lastRunAt?: string(name='LastRunAt'),
  scanQueriesRange?: int32(name='ScanQueriesRange'),
  schedulingSettings?: string(name='SchedulingSettings'),
  taskName?: string(name='TaskName'),
}

model OpenStructRefreshJobModel {
  endTime?: string(name='EndTime'),
  name?: string(name='Name'),
  processid?: string(name='Processid'),
  refreshInterval?: string(name='RefreshInterval'),
  refreshModel?: string(name='RefreshModel'),
  resourceGroup?: string(name='ResourceGroup'),
  schemaName?: string(name='SchemaName'),
  startTime?: string(name='StartTime'),
  status?: string(name='Status'),
}

model AllocateClusterPublicConnectionRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the public endpoint.

*   The prefix can contain lowercase letters, digits, and hyphens (-). It must start with a lowercase letter.
*   The prefix can be up to 30 characters in length.', example='test12'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1z5d2q71is2****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
}

model AllocateClusterPublicConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='868EF07F-D0B2-5043-B092-0C14CD00B65A'),
}

model AllocateClusterPublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateClusterPublicConnectionResponseBody(name='body'),
}

/**
 * @summary Applies for a public endpoint for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request AllocateClusterPublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateClusterPublicConnectionResponse
 */
async function allocateClusterPublicConnectionWithOptions(request: AllocateClusterPublicConnectionRequest, runtime: Util.RuntimeOptions): AllocateClusterPublicConnectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AllocateClusterPublicConnection',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Applies for a public endpoint for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request AllocateClusterPublicConnectionRequest
 * @return AllocateClusterPublicConnectionResponse
 */
async function allocateClusterPublicConnection(request: AllocateClusterPublicConnectionRequest): AllocateClusterPublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return allocateClusterPublicConnectionWithOptions(request, runtime);
}

model ApplyAdviceByIdRequest {
  adviceDate?: long(name='AdviceDate', description='The date on which you want to apply the suggestion. Format: yyyyMMdd.', example='20221101'),
  adviceId?: string(name='AdviceId', description='The suggestion ID.', example='0baf1f52-53df-487f-8292-99a03716****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model ApplyAdviceByIdResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5DC10091-348D-12B1-906D-AB49D658012E'),
}

model ApplyAdviceByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyAdviceByIdResponseBody(name='body'),
}

/**
 * @summary Applies an optimization suggestion.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ApplyAdviceByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyAdviceByIdResponse
 */
async function applyAdviceByIdWithOptions(request: ApplyAdviceByIdRequest, runtime: Util.RuntimeOptions): ApplyAdviceByIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceDate)) {
    query['AdviceDate'] = request.adviceDate;
  }
  if (!Util.isUnset(request.adviceId)) {
    query['AdviceId'] = request.adviceId;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyAdviceById',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Applies an optimization suggestion.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ApplyAdviceByIdRequest
 * @return ApplyAdviceByIdResponse
 */
async function applyAdviceById(request: ApplyAdviceByIdRequest): ApplyAdviceByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyAdviceByIdWithOptions(request, runtime);
}

model AttachUserENIRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp11q28kvl688****'),
}

model AttachUserENIResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model AttachUserENIResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachUserENIResponseBody(name='body'),
}

/**
 * @summary Attaches an elastic network interface (ENI) to an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request AttachUserENIRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachUserENIResponse
 */
async function attachUserENIWithOptions(request: AttachUserENIRequest, runtime: Util.RuntimeOptions): AttachUserENIResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachUserENI',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Attaches an elastic network interface (ENI) to an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request AttachUserENIRequest
 * @return AttachUserENIResponse
 */
async function attachUserENI(request: AttachUserENIRequest): AttachUserENIResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachUserENIWithOptions(request, runtime);
}

model BatchApplyAdviceByIdListRequest {
  adviceDate?: long(name='AdviceDate', description='The date on which you want to apply the suggestion. Format: yyyyMMdd.', example='20221115'),
  adviceIdList?: string(name='AdviceIdList', description='The IDs of the suggestions that you want to apply. Separate multiple IDs with commas (,).', example='c2589ff3-e86c-4f19-80c8-2aeb7dd9****,53414470-ebf4-4a53-a312-8a1ad8fd****,6e8dce84-fec8-4b0b-9c04-b0cea12c****,b3b9703d-55ca-47e0-96dd-6a4a9dbf****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model BatchApplyAdviceByIdListResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='86F92D26-B774-5FA1-8E53-82CBEEEBB012'),
}

model BatchApplyAdviceByIdListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchApplyAdviceByIdListResponseBody(name='body'),
}

/**
 * @summary Applies optimization suggestions.
 *
 * @param request BatchApplyAdviceByIdListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchApplyAdviceByIdListResponse
 */
async function batchApplyAdviceByIdListWithOptions(request: BatchApplyAdviceByIdListRequest, runtime: Util.RuntimeOptions): BatchApplyAdviceByIdListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceDate)) {
    query['AdviceDate'] = request.adviceDate;
  }
  if (!Util.isUnset(request.adviceIdList)) {
    query['AdviceIdList'] = request.adviceIdList;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchApplyAdviceByIdList',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Applies optimization suggestions.
 *
 * @param request BatchApplyAdviceByIdListRequest
 * @return BatchApplyAdviceByIdListResponse
 */
async function batchApplyAdviceByIdList(request: BatchApplyAdviceByIdListRequest): BatchApplyAdviceByIdListResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchApplyAdviceByIdListWithOptions(request, runtime);
}

model BindAccountRequest {
  accountName?: string(name='AccountName', description='The standard account of the cluster.

This parameter is required.', example='test_accout'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-wz99d9nh532****'),
  ramUser?: string(name='RamUser', description='The ID of the RAM user.

This parameter is required.', example='1444832459****'),
}

model BindAccountResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='DFF27323-3868-5F8A-917D-5D1D06B6BC0D'),
}

model BindAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAccountResponseBody(name='body'),
}

/**
 * @summary Associates a standard account of an AnalyticDB for MySQL cluster with a Resource Access Management (RAM) user.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request BindAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAccountResponse
 */
async function bindAccountWithOptions(request: BindAccountRequest, runtime: Util.RuntimeOptions): BindAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ramUser)) {
    query['RamUser'] = request.ramUser;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAccount',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates a standard account of an AnalyticDB for MySQL cluster with a Resource Access Management (RAM) user.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request BindAccountRequest
 * @return BindAccountResponse
 */
async function bindAccount(request: BindAccountRequest): BindAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAccountWithOptions(request, runtime);
}

model BindDBResourceGroupWithUserRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

This parameter is required.', example='test'),
  groupUser?: string(name='GroupUser', description='The name of the database account. It can be a standard account or a privileged account.

This parameter is required.', example='accout'),
}

model BindDBResourceGroupWithUserResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model BindDBResourceGroupWithUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindDBResourceGroupWithUserResponseBody(name='body'),
}

/**
 * @summary Associates a resource group with a database account.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request BindDBResourceGroupWithUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindDBResourceGroupWithUserResponse
 */
async function bindDBResourceGroupWithUserWithOptions(request: BindDBResourceGroupWithUserRequest, runtime: Util.RuntimeOptions): BindDBResourceGroupWithUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupUser)) {
    query['GroupUser'] = request.groupUser;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindDBResourceGroupWithUser',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates a resource group with a database account.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request BindDBResourceGroupWithUserRequest
 * @return BindDBResourceGroupWithUserResponse
 */
async function bindDBResourceGroupWithUser(request: BindDBResourceGroupWithUserRequest): BindDBResourceGroupWithUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindDBResourceGroupWithUserWithOptions(request, runtime);
}

model CancelSparkReplStatementRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query Spark application IDs.', example='s202411071444hzdvk486d9d2001****'),
  sessionId?: long(name='SessionId', description='The session ID.', example='456'),
  statementId?: long(name='StatementId', description='The unique ID of the code block in the Spark job.', example='123'),
}

model CancelSparkReplStatementResponseBody = {
  data?: {
    aliyunUid?: long(name='AliyunUid', description='The ID of the Alibaba Cloud account that owns the cluster.', example='190063530332****'),
    code?: string(name='Code', description='The code that is executed.', example='print(1+1)'),
    codeState?: string(name='CodeState', description='The code execution status. Valid values:

*   CANCELLED
*   RUNNING
*   SUCCEEDED
*   ERROR', example='RUNNING'),
    codeType?: string(name='CodeType', description='The code type. Valid values:

*   SCALA
*   PYTHON', example='PYTHON'),
    columns?: [ string ](name='Columns', description='The column names.'),
    endTime?: long(name='EndTime', description='The end time of the execution. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1730968056000'),
    error?: string(name='Error', description='The error message.', example='StackOverflow Exception:'),
    output?: string(name='Output', description='The code execution result, which is a JSON string that conforms to Apache Livy.', example='{"text/plain": "2"}'),
    outputType?: string(name='OutputType', description='The execution result type, which is in the JSON format. Valid values:

*   TEXT: the text content that conforms to Apache Livy.
*   TABLE: the table content that conforms to Apache Livy.', example='TEXT'),
    startTime?: long(name='StartTime', description='The start time of the execution. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1730968056000'),
    statementId?: long(name='StatementId', description='The unique ID of the code block in the Spark job.', example='123'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model CancelSparkReplStatementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelSparkReplStatementResponseBody(name='body'),
}

/**
 * @summary Terminates part of the code in a Spark job.
 *
 * @param request CancelSparkReplStatementRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelSparkReplStatementResponse
 */
async function cancelSparkReplStatementWithOptions(request: CancelSparkReplStatementRequest, runtime: Util.RuntimeOptions): CancelSparkReplStatementResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.statementId)) {
    body['StatementId'] = request.statementId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelSparkReplStatement',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates part of the code in a Spark job.
 *
 * @param request CancelSparkReplStatementRequest
 * @return CancelSparkReplStatementResponse
 */
async function cancelSparkReplStatement(request: CancelSparkReplStatementRequest): CancelSparkReplStatementResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelSparkReplStatementWithOptions(request, runtime);
}

model CancelSparkWarehouseBatchSQLRequest {
  agency?: string(name='Agency', description='The name of the client, which can be up to 16 characters in length. Specify a descriptive name that makes it easy to identify.', example='DMS'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-uf6485635f***'),
  queryId?: string(name='QueryId', description='The query ID of the Spark SQL statement.

This parameter is required.', example='sq202501011001s****'),
}

model CancelSparkWarehouseBatchSQLResponseBody = {
  data?: SparkBatchSQL(name='Data', description='The returned data.', example='123'),
  requestId?: string(name='RequestId', description='The request ID.', example='771C5FAA-530F-52F7-B84D-EBAD45***'),
}

model CancelSparkWarehouseBatchSQLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelSparkWarehouseBatchSQLResponseBody(name='body'),
}

/**
 * @summary Cancels the execution of a Spark SQL statement.
 *
 * @param request CancelSparkWarehouseBatchSQLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelSparkWarehouseBatchSQLResponse
 */
async function cancelSparkWarehouseBatchSQLWithOptions(request: CancelSparkWarehouseBatchSQLRequest, runtime: Util.RuntimeOptions): CancelSparkWarehouseBatchSQLResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.agency)) {
    body['Agency'] = request.agency;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.queryId)) {
    body['QueryId'] = request.queryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelSparkWarehouseBatchSQL',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Cancels the execution of a Spark SQL statement.
 *
 * @param request CancelSparkWarehouseBatchSQLRequest
 * @return CancelSparkWarehouseBatchSQLResponse
 */
async function cancelSparkWarehouseBatchSQL(request: CancelSparkWarehouseBatchSQLRequest): CancelSparkWarehouseBatchSQLResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelSparkWarehouseBatchSQLWithOptions(request, runtime);
}

model CheckBindRamUserRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.', example='amv-wz9842849v6****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
}

model CheckBindRamUserResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2FB9DCA3-DA56-5B43-A9A0-68E3D0E6AA84'),
  result?: boolean(name='Result', description='The returned result of the request. Valid values:

*   **true**: the database account is associated with a RAM user.
*   **false**: the database account is not associated with a RAM user.', example='true'),
}

model CheckBindRamUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckBindRamUserResponseBody(name='body'),
}

/**
 * @summary Queries whether a database account of an AnalyticDB for MySQL cluster is associated with a Resource Access Management (RAM) user.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CheckBindRamUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckBindRamUserResponse
 */
async function checkBindRamUserWithOptions(request: CheckBindRamUserRequest, runtime: Util.RuntimeOptions): CheckBindRamUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckBindRamUser',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether a database account of an AnalyticDB for MySQL cluster is associated with a Resource Access Management (RAM) user.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CheckBindRamUserRequest
 * @return CheckBindRamUserResponse
 */
async function checkBindRamUser(request: CheckBindRamUserRequest): CheckBindRamUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkBindRamUserWithOptions(request, runtime);
}

model CheckSampleDataSetRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-wz9r8f67h4cqz41u'),
}

model CheckSampleDataSetResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='0CE655C3-C211-513D-A42F-D4AE2D1A867C'),
  status?: string(name='Status', description='The state of the built-in dataset. Valid values:

*   **SUCCEED**: The dataset is loaded.
*   **INIT**: The dataset is being loaded.
*   **FAILED**: The dataset failed to be loaded.
*   **UNINITIALIZED**: The dataset is not loaded.', example='UNINITIALIZED'),
}

model CheckSampleDataSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckSampleDataSetResponseBody(name='body'),
}

/**
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CheckSampleDataSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckSampleDataSetResponse
 */
async function checkSampleDataSetWithOptions(request: CheckSampleDataSetRequest, runtime: Util.RuntimeOptions): CheckSampleDataSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckSampleDataSet',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CheckSampleDataSetRequest
 * @return CheckSampleDataSetResponse
 */
async function checkSampleDataSet(request: CheckSampleDataSetRequest): CheckSampleDataSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkSampleDataSetWithOptions(request, runtime);
}

model CreateAPSJobRequest {
  apsJobName?: string(name='ApsJobName', description='The name of the synchronization job.

This parameter is required.', example='aps-xxxxx'),
  dbList?: string(name='DbList', description='The objects to be synchronized.

This parameter is required.', example='{"EntireInstance":true}'),
  destinationEndpointInstanceID?: string(name='DestinationEndpointInstanceID', description='The name of the database account of the destination cluster.

This parameter is required.', example='amv-xxxxx'),
  destinationEndpointPassword?: string(name='DestinationEndpointPassword', description='The password of the database account of the destination cluster.', example='******'),
  destinationEndpointUserName?: string(name='DestinationEndpointUserName', description='The name of the database account of the destination cluster.', example='******'),
  partitionList?: string(name='PartitionList', description='The partitions.', example='{}'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-shanghai'),
  sourceEndpointInstanceID?: string(name='SourceEndpointInstanceID', description='The ID of the source instance or cluster.

This parameter is required.', example='pc-xxxxx'),
  sourceEndpointPassword?: string(name='SourceEndpointPassword', description='The password of the database account of the source instance.', example='******'),
  sourceEndpointRegion?: string(name='SourceEndpointRegion', description='The region ID of the source instance.', example='cn-beijing'),
  sourceEndpointUserName?: string(name='SourceEndpointUserName', description='The name of the database account of the source instance.', example='xxxx'),
  targetTableMode?: string(name='TargetTableMode', description='The mode of the destination table.', example='1'),
}

model CreateAPSJobResponseBody = {
  apsJobId?: string(name='ApsJobId', description='The job ID.', example='aps-bj1xxxxxx'),
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D1B8ED33-5E9B-512D-B188-1579ED6xxx'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
}

model CreateAPSJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAPSJobResponseBody(name='body'),
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) job.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateAPSJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAPSJobResponse
 */
async function createAPSJobWithOptions(request: CreateAPSJobRequest, runtime: Util.RuntimeOptions): CreateAPSJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apsJobName)) {
    body['ApsJobName'] = request.apsJobName;
  }
  if (!Util.isUnset(request.dbList)) {
    body['DbList'] = request.dbList;
  }
  if (!Util.isUnset(request.destinationEndpointInstanceID)) {
    body['DestinationEndpointInstanceID'] = request.destinationEndpointInstanceID;
  }
  if (!Util.isUnset(request.destinationEndpointPassword)) {
    body['DestinationEndpointPassword'] = request.destinationEndpointPassword;
  }
  if (!Util.isUnset(request.destinationEndpointUserName)) {
    body['DestinationEndpointUserName'] = request.destinationEndpointUserName;
  }
  if (!Util.isUnset(request.partitionList)) {
    body['PartitionList'] = request.partitionList;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sourceEndpointInstanceID)) {
    body['SourceEndpointInstanceID'] = request.sourceEndpointInstanceID;
  }
  if (!Util.isUnset(request.sourceEndpointPassword)) {
    body['SourceEndpointPassword'] = request.sourceEndpointPassword;
  }
  if (!Util.isUnset(request.sourceEndpointRegion)) {
    body['SourceEndpointRegion'] = request.sourceEndpointRegion;
  }
  if (!Util.isUnset(request.sourceEndpointUserName)) {
    body['SourceEndpointUserName'] = request.sourceEndpointUserName;
  }
  if (!Util.isUnset(request.targetTableMode)) {
    body['TargetTableMode'] = request.targetTableMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAPSJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) job.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateAPSJobRequest
 * @return CreateAPSJobResponse
 */
async function createAPSJob(request: CreateAPSJobRequest): CreateAPSJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAPSJobWithOptions(request, runtime);
}

model CreateAccountRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the account.

*   The description cannot start with `http://` or `https://`.
*   The description can be up to 256 characters in length.', example='test'),
  accountName?: string(name='AccountName', description='The name of the database account.

*   The name must start with a lowercase letter and end with a lowercase letter or a digit.
*   The name can contain lowercase letters, digits, and underscores (_).
*   The name must be 2 to 16 characters in length.
*   Reserved account names such as root, admin, and opsadmin cannot be used.

This parameter is required.', example='test_accout'),
  accountPassword?: string(name='AccountPassword', description='The password of the database account.

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   Special characters include `! @ # $ % ^ & * ( ) _ + - =`
*   The password must be 8 to 32 characters in length.

This parameter is required.', example='Test_accout1'),
  accountType?: string(name='AccountType', description='The type of the database account. Valid values:

*   **Normal**: standard account.
*   **Super**: privileged account.

This parameter is required.', example='Normal'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
}

model CreateAccountResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2FED790E-FB61-4721-8C1C-07C627FA5A19'),
}

model CreateAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAccountResponseBody(name='body'),
}

/**
 * @summary Creates a database account for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAccountResponse
 */
async function createAccountWithOptions(request: CreateAccountRequest, runtime: Util.RuntimeOptions): CreateAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccount',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a database account for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateAccountRequest
 * @return CreateAccountResponse
 */
async function createAccount(request: CreateAccountRequest): CreateAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccountWithOptions(request, runtime);
}

model CreateApsCopyWorkloadRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  datasourceId?: int32(name='DatasourceId', description='The data source ID.', example='123'),
  dbName?: string(name='DbName', description='The name of the database.', example='dbName'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
  workloadId?: string(name='WorkloadId', description='The job ID.

This parameter is required.', example='aps-******'),
  workloadType?: string(name='WorkloadType', description='The type of the job.

This parameter is required.', example='SLS_INGESTION_ADB'),
}

model CreateApsCopyWorkloadResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  data?: map[string]any(name='Data', description='The returned data.', example='-'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateApsCopyWorkloadResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApsCopyWorkloadResponseBody(name='body'),
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) replication job.
 *
 * @param request CreateApsCopyWorkloadRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApsCopyWorkloadResponse
 */
async function createApsCopyWorkloadWithOptions(request: CreateApsCopyWorkloadRequest, runtime: Util.RuntimeOptions): CreateApsCopyWorkloadResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tableName)) {
    body['TableName'] = request.tableName;
  }
  if (!Util.isUnset(request.workloadId)) {
    body['WorkloadId'] = request.workloadId;
  }
  if (!Util.isUnset(request.workloadType)) {
    body['WorkloadType'] = request.workloadType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateApsCopyWorkload',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) replication job.
 *
 * @param request CreateApsCopyWorkloadRequest
 * @return CreateApsCopyWorkloadResponse
 */
async function createApsCopyWorkload(request: CreateApsCopyWorkloadRequest): CreateApsCopyWorkloadResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApsCopyWorkloadWithOptions(request, runtime);
}

model CreateApsDatasoureRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-xxxxx'),
  databricksInfo?: {
    accessToken?: string(name='AccessToken', description='The token that is used to access Databricks.', example='******'),
    workspaceURL?: string(name='WorkspaceURL', description='The URL of the workspace.', example='xxxxx'),
  }(name='DatabricksInfo', description='The information about the Databricks data source.', example='-'),
  datasourceDescription?: string(name='DatasourceDescription', description='The description of the data source.', example='description'),
  datasourceName?: string(name='DatasourceName', description='The name of the data source.

This parameter is required.', example='sls-******'),
  datasourceType?: string(name='DatasourceType', description='The type of the data source.

This parameter is required.', example='KAFKA'),
  hiveInfo?: {
    clusterId?: string(name='ClusterId', description='The cluster ID.', example='******'),
    hostConfig?: string(name='HostConfig', description='The configuration of the host.', example='******'),
    metaStoreUri?: string(name='MetaStoreUri', description='The URL of the Hive Metastore.', example='******'),
    securityGroup?: string(name='SecurityGroup', description='The security group ID.', example='sg-uf*******h'),
    vswitch?: string(name='Vswitch', description='The vSwitch ID.', example='vsw-bp1*****k'),
  }(name='HiveInfo', description='The information about the Hive data source.', example='-'),
  kafkaInfo?: {
    kafkaClusterId?: string(name='KafkaClusterId', description='The ID of the Apache Kafka instance.', example='******'),
    kafkaTopic?: string(name='KafkaTopic', description='The topic of the Apache Kafka instance.', example='test'),
  }(name='KafkaInfo', description='The information about the source Apache Kafka instance.', example='-'),
  mode?: string(name='Mode', description='The mode.', example='ALI_CLOUD_INSTANCE'),
  polarDBMysqlInfo?: {
    across?: boolean(name='Across', description='Specifies whether the data source is a cross-account resource. Valid values:

*   **true**
*   **false**', example='false'),
    acrossRole?: string(name='AcrossRole', description='The name of the cross-account role.', example='test-role'),
    acrossUid?: string(name='AcrossUid', description='The cross-account UID.', example='123456789*'),
    connectUrl?: string(name='ConnectUrl', description='The URL used to connect to the custom ApsaraDB RDS for MySQL instance.', example='****'),
    instanceId?: string(name='InstanceId', description='The instance ID.', example='pc-bp*********'),
    password?: string(name='Password', description='The password.', example='***'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-shanghai'),
    securityGroup?: string(name='SecurityGroup', description='The security group ID.', example='sg-******'),
    userName?: string(name='UserName', description='The username used to access the instance.', example='test-user-name'),
  }(name='PolarDBMysqlInfo', description='The information about the source PolarDB for MySQL cluster.', example='-'),
  polarDBXInfo?: {
    instanceId?: string(name='InstanceId', description='The instance ID.', example='-'),
  }(name='PolarDBXInfo', description='The information about the source PolarDB-X instance.', example='-'),
  rdsMysqlInfo?: {
    connectUrl?: string(name='ConnectUrl', description='The URL used to connect to the read-only instance.', example='******'),
    instanceId?: string(name='InstanceId', description='The instance ID.', example='rm-xxxxxxx'),
    password?: string(name='Password', description='The password of the database account of the instance.', example='******'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-shanghai'),
    securityGroup?: string(name='SecurityGroup', description='The security group ID.', example='sg-******'),
    userName?: string(name='UserName', description='The name of the database account of the instance.'),
  }(name='RdsMysqlInfo', description='The information about the source ApsaraDB RDS for MySQL instance.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-shanghai'),
  slsInfo?: {
    across?: boolean(name='Across', description='Specifies whether the data source is a cross-account resource.', example='false'),
    acrossRole?: string(name='AcrossRole', description='The name of the cross-account role.', example='yyy'),
    acrossUid?: string(name='AcrossUid', description='The cross-account UID.', example='xxxx'),
    project?: string(name='Project', description='The SLS project.', example='test-project'),
    sourceRegionId?: string(name='SourceRegionId', description='The region ID.', example='cn-beijing'),
    store?: string(name='Store', description='The name of the SLS Logstore.', example='test-store'),
  }(name='SlsInfo', description='The information about the source Simple Log Service (SLS) instance or cluster.', example='-'),
}

model CreateApsDatasoureShrinkRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-xxxxx'),
  databricksInfoShrink?: string(name='DatabricksInfo', description='The information about the Databricks data source.', example='-'),
  datasourceDescription?: string(name='DatasourceDescription', description='The description of the data source.', example='description'),
  datasourceName?: string(name='DatasourceName', description='The name of the data source.

This parameter is required.', example='sls-******'),
  datasourceType?: string(name='DatasourceType', description='The type of the data source.

This parameter is required.', example='KAFKA'),
  hiveInfoShrink?: string(name='HiveInfo', description='The information about the Hive data source.', example='-'),
  kafkaInfoShrink?: string(name='KafkaInfo', description='The information about the source Apache Kafka instance.', example='-'),
  mode?: string(name='Mode', description='The mode.', example='ALI_CLOUD_INSTANCE'),
  polarDBMysqlInfoShrink?: string(name='PolarDBMysqlInfo', description='The information about the source PolarDB for MySQL cluster.', example='-'),
  polarDBXInfoShrink?: string(name='PolarDBXInfo', description='The information about the source PolarDB-X instance.', example='-'),
  rdsMysqlInfoShrink?: string(name='RdsMysqlInfo', description='The information about the source ApsaraDB RDS for MySQL instance.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-shanghai'),
  slsInfoShrink?: string(name='SlsInfo', description='The information about the source Simple Log Service (SLS) instance or cluster.', example='-'),
}

model CreateApsDatasoureResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='200'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-7xxxxx'),
  data?: string(name='Data', description='The information about the cluster resource usage.', example='69'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='65D2***-45C1-5C18-**********'),
  success?: boolean(name='Success', description='Indicates whether the dry run succeeds. Valid values:

*   **true**
*   **false**', example='True'),
}

model CreateApsDatasoureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApsDatasoureResponseBody(name='body'),
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) data source.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param tmpReq CreateApsDatasoureRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApsDatasoureResponse
 */
async function createApsDatasoureWithOptions(tmpReq: CreateApsDatasoureRequest, runtime: Util.RuntimeOptions): CreateApsDatasoureResponse {
  Util.validateModel(tmpReq);
  var request = new CreateApsDatasoureShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.databricksInfo)) {
    request.databricksInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.databricksInfo, 'DatabricksInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.hiveInfo)) {
    request.hiveInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.hiveInfo, 'HiveInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.kafkaInfo)) {
    request.kafkaInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.kafkaInfo, 'KafkaInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.polarDBMysqlInfo)) {
    request.polarDBMysqlInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.polarDBMysqlInfo, 'PolarDBMysqlInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.polarDBXInfo)) {
    request.polarDBXInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.polarDBXInfo, 'PolarDBXInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.rdsMysqlInfo)) {
    request.rdsMysqlInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rdsMysqlInfo, 'RdsMysqlInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.slsInfo)) {
    request.slsInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.slsInfo, 'SlsInfo', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.databricksInfoShrink)) {
    body['DatabricksInfo'] = request.databricksInfoShrink;
  }
  if (!Util.isUnset(request.datasourceDescription)) {
    body['DatasourceDescription'] = request.datasourceDescription;
  }
  if (!Util.isUnset(request.datasourceName)) {
    body['DatasourceName'] = request.datasourceName;
  }
  if (!Util.isUnset(request.datasourceType)) {
    body['DatasourceType'] = request.datasourceType;
  }
  if (!Util.isUnset(request.hiveInfoShrink)) {
    body['HiveInfo'] = request.hiveInfoShrink;
  }
  if (!Util.isUnset(request.kafkaInfoShrink)) {
    body['KafkaInfo'] = request.kafkaInfoShrink;
  }
  if (!Util.isUnset(request.mode)) {
    body['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.polarDBMysqlInfoShrink)) {
    body['PolarDBMysqlInfo'] = request.polarDBMysqlInfoShrink;
  }
  if (!Util.isUnset(request.polarDBXInfoShrink)) {
    body['PolarDBXInfo'] = request.polarDBXInfoShrink;
  }
  if (!Util.isUnset(request.rdsMysqlInfoShrink)) {
    body['RdsMysqlInfo'] = request.rdsMysqlInfoShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.slsInfoShrink)) {
    body['SlsInfo'] = request.slsInfoShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateApsDatasoure',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) data source.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateApsDatasoureRequest
 * @return CreateApsDatasoureResponse
 */
async function createApsDatasoure(request: CreateApsDatasoureRequest): CreateApsDatasoureResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApsDatasoureWithOptions(request, runtime);
}

model CreateApsHiveJobRequest {
  advancedConfig?: string(name='AdvancedConfig', description='The advanced configurations.', example='-'),
  conflictStrategy?: string(name='ConflictStrategy', description='The policy to handle tables with the same name in the destination cluster.', example='Intercept: reports error and aborts.
Ignore: ignores and continues migrating the relevant tables.
Skip: skips related tables and only migrates other tables.'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

This parameter is required.', example='amv-****'),
  datasourceId?: long(name='DatasourceId', description='The data source ID.', example='40'),
  fullComputeUnit?: string(name='FullComputeUnit', description='The number of AnalyticDB compute units (ACUs) required for data migration.

This parameter is required.', example='16'),
  ossLocation?: string(name='OssLocation', description='The path of the destination data lakehouse in an Object Storage Service (OSS) bucket.

This parameter is required.'),
  parallelism?: int32(name='Parallelism', description='The number of tasks that are allowed in parallel.', example='8'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceGroup?: string(name='ResourceGroup', description='The name of the resource group.

This parameter is required.', example='user_default'),
  syncAllowExpression?: string(name='SyncAllowExpression', description='The expression that allows objects to be synchronized.', example='*'),
  syncDenyExpression?: string(name='SyncDenyExpression', description='The expression that denies objects to be synchronized.', example='abc'),
  targetType?: string(name='TargetType', description='The destination type.', example='OSS'),
  workloadName?: string(name='WorkloadName', description='The name of the workload.

This parameter is required.', example='xxx-20240224100253'),
}

model CreateApsHiveJobResponseBody = {
  code?: string(name='Code', description='The response code.', example='InvalidInput'),
  data?: string(name='Data', description='The returned data.', example='-'),
  httpStatusCode?: string(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='2895BB82-B2C1-408E-AA73-DB8D59******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateApsHiveJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApsHiveJobResponseBody(name='body'),
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) job from a Hive data source.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateApsHiveJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApsHiveJobResponse
 */
async function createApsHiveJobWithOptions(request: CreateApsHiveJobRequest, runtime: Util.RuntimeOptions): CreateApsHiveJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.advancedConfig)) {
    body['AdvancedConfig'] = request.advancedConfig;
  }
  if (!Util.isUnset(request.conflictStrategy)) {
    body['ConflictStrategy'] = request.conflictStrategy;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.fullComputeUnit)) {
    body['FullComputeUnit'] = request.fullComputeUnit;
  }
  if (!Util.isUnset(request.ossLocation)) {
    body['OssLocation'] = request.ossLocation;
  }
  if (!Util.isUnset(request.parallelism)) {
    body['Parallelism'] = request.parallelism;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    body['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.syncAllowExpression)) {
    body['SyncAllowExpression'] = request.syncAllowExpression;
  }
  if (!Util.isUnset(request.syncDenyExpression)) {
    body['SyncDenyExpression'] = request.syncDenyExpression;
  }
  if (!Util.isUnset(request.targetType)) {
    body['TargetType'] = request.targetType;
  }
  if (!Util.isUnset(request.workloadName)) {
    body['WorkloadName'] = request.workloadName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateApsHiveJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) job from a Hive data source.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateApsHiveJobRequest
 * @return CreateApsHiveJobResponse
 */
async function createApsHiveJob(request: CreateApsHiveJobRequest): CreateApsHiveJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApsHiveJobWithOptions(request, runtime);
}

model CreateApsSlsADBJobRequest {
  acrossRole?: string(name='AcrossRole', description='The name of the cross-account role.', example='test-role'),
  acrossUid?: string(name='AcrossUid', description='The cross-account UID.', example='123456'),
  advancedConfig?: string(name='AdvancedConfig', description='The advanced configurations.', example='-'),
  columns?: [ 
    {
      mapName?: string(name='MapName', description='The name of the mapping.', example='test'),
      mapType?: string(name='MapType', description='The type of the mapping.', example='int'),
      name?: string(name='Name', description='The name of the column.', example='id'),
      type?: string(name='Type', description='The data type of the column.', example='bigint'),
    }
  ](name='Columns', description='The information about columns.

This parameter is required.', example='-'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*********'),
  datasourceId?: long(name='DatasourceId', description='The data source ID.', example='327'),
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='dbName'),
  dirtyDataHandleMode?: string(name='DirtyDataHandleMode', description='The dirty data processing mode.

This parameter is required.', example='-'),
  dirtyDataProcessPattern?: string(name='DirtyDataProcessPattern', description='The dirty data processing mode.', example='STOP'),
  exactlyOnce?: string(name='ExactlyOnce', description='Specifies whether to enable the consistency check.', example='false'),
  fullComputeUnit?: string(name='FullComputeUnit', description='The number of full AnalyticDB compute units (ACUs).', example='16'),
  hudiAdvancedConfig?: string(name='HudiAdvancedConfig', description='The advanced configurations of Hudi.', example='-'),
  incrementalComputeUnit?: string(name='IncrementalComputeUnit', description='The number of increment ACUs.', example='168'),
  lakehouseId?: long(name='LakehouseId', description='The lakehouse ID.', example='123'),
  maxOffsetsPerTrigger?: long(name='MaxOffsetsPerTrigger', description='The latest offset.', example='-'),
  ossLocation?: string(name='OssLocation', description='The Object Storage Service (OSS) URL.', example='oss://test*'),
  outputFormat?: string(name='OutputFormat', description='The format of the output file.', example='-'),
  partitionSpecs?: [  map[string]any ](name='PartitionSpecs', description='The information about partition.', example='-'),
  password?: string(name='Password', description='The password of the database account.

This parameter is required.', example='test_user'),
  primaryKeyDefinition?: string(name='PrimaryKeyDefinition', description='The definition of the primary key.', example='-'),
  project?: string(name='Project', description='The name of the SLS project.', example='test'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The name of the resource group.', example='test'),
  sourceRegionId?: string(name='SourceRegionId', description='The region ID of the source cluster.', example='cn-beijing'),
  startingOffsets?: string(name='StartingOffsets', description='The start offset.

This parameter is required.', example='test'),
  store?: string(name='Store', description='The SLS Logstore.', example='test'),
  tableName?: string(name='TableName', description='The name of the table.

This parameter is required.', example='test'),
  targetGenerateRule?: string(name='TargetGenerateRule', description='The rules for generating the destination database.', example='-'),
  targetType?: string(name='TargetType', description='The destination type.', example='ADB'),
  unixTimestampConvert?: {
    convert?: string(name='Convert', description='Specifies whether to enable the conversion of timestamps.', example='false'),
    format?: string(name='Format', description='The format of the timestamp.', example='yyyyMMdd'),
    transform?: boolean(name='Transform', description='Specifies whether to enable the timestamp conversion.', example='false'),
  }(name='UnixTimestampConvert', description='The timestamp conversion.', example='-'),
  userName?: string(name='UserName', description='The name of the database account.

This parameter is required.', example='user_test'),
  workloadName?: string(name='WorkloadName', description='The name of the workload.

This parameter is required.', example='sls-******'),
}

model CreateApsSlsADBJobShrinkRequest {
  acrossRole?: string(name='AcrossRole', description='The name of the cross-account role.', example='test-role'),
  acrossUid?: string(name='AcrossUid', description='The cross-account UID.', example='123456'),
  advancedConfig?: string(name='AdvancedConfig', description='The advanced configurations.', example='-'),
  columnsShrink?: string(name='Columns', description='The information about columns.

This parameter is required.', example='-'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*********'),
  datasourceId?: long(name='DatasourceId', description='The data source ID.', example='327'),
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='dbName'),
  dirtyDataHandleMode?: string(name='DirtyDataHandleMode', description='The dirty data processing mode.

This parameter is required.', example='-'),
  dirtyDataProcessPattern?: string(name='DirtyDataProcessPattern', description='The dirty data processing mode.', example='STOP'),
  exactlyOnce?: string(name='ExactlyOnce', description='Specifies whether to enable the consistency check.', example='false'),
  fullComputeUnit?: string(name='FullComputeUnit', description='The number of full AnalyticDB compute units (ACUs).', example='16'),
  hudiAdvancedConfig?: string(name='HudiAdvancedConfig', description='The advanced configurations of Hudi.', example='-'),
  incrementalComputeUnit?: string(name='IncrementalComputeUnit', description='The number of increment ACUs.', example='168'),
  lakehouseId?: long(name='LakehouseId', description='The lakehouse ID.', example='123'),
  maxOffsetsPerTrigger?: long(name='MaxOffsetsPerTrigger', description='The latest offset.', example='-'),
  ossLocation?: string(name='OssLocation', description='The Object Storage Service (OSS) URL.', example='oss://test*'),
  outputFormat?: string(name='OutputFormat', description='The format of the output file.', example='-'),
  partitionSpecsShrink?: string(name='PartitionSpecs', description='The information about partition.', example='-'),
  password?: string(name='Password', description='The password of the database account.

This parameter is required.', example='test_user'),
  primaryKeyDefinition?: string(name='PrimaryKeyDefinition', description='The definition of the primary key.', example='-'),
  project?: string(name='Project', description='The name of the SLS project.', example='test'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The name of the resource group.', example='test'),
  sourceRegionId?: string(name='SourceRegionId', description='The region ID of the source cluster.', example='cn-beijing'),
  startingOffsets?: string(name='StartingOffsets', description='The start offset.

This parameter is required.', example='test'),
  store?: string(name='Store', description='The SLS Logstore.', example='test'),
  tableName?: string(name='TableName', description='The name of the table.

This parameter is required.', example='test'),
  targetGenerateRule?: string(name='TargetGenerateRule', description='The rules for generating the destination database.', example='-'),
  targetType?: string(name='TargetType', description='The destination type.', example='ADB'),
  unixTimestampConvertShrink?: string(name='UnixTimestampConvert', description='The timestamp conversion.', example='-'),
  userName?: string(name='UserName', description='The name of the database account.

This parameter is required.', example='user_test'),
  workloadName?: string(name='WorkloadName', description='The name of the workload.

This parameter is required.', example='sls-******'),
}

model CreateApsSlsADBJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  data?: string(name='Data', description='The returned data.', example='-'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the dry run succeeds. Valid values:

*   **true**
*   **false**', example='True'),
}

model CreateApsSlsADBJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApsSlsADBJobResponseBody(name='body'),
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) job from Simple Log Service (SLS) to an AnalyticDB for MySQL Data Warehouse Edition cluster.
 *
 * @param tmpReq CreateApsSlsADBJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApsSlsADBJobResponse
 */
async function createApsSlsADBJobWithOptions(tmpReq: CreateApsSlsADBJobRequest, runtime: Util.RuntimeOptions): CreateApsSlsADBJobResponse {
  Util.validateModel(tmpReq);
  var request = new CreateApsSlsADBJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.columns)) {
    request.columnsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.columns, 'Columns', 'json');
  }
  if (!Util.isUnset(tmpReq.partitionSpecs)) {
    request.partitionSpecsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.partitionSpecs, 'PartitionSpecs', 'json');
  }
  if (!Util.isUnset(tmpReq.unixTimestampConvert)) {
    request.unixTimestampConvertShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.unixTimestampConvert, 'UnixTimestampConvert', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.acrossRole)) {
    body['AcrossRole'] = request.acrossRole;
  }
  if (!Util.isUnset(request.acrossUid)) {
    body['AcrossUid'] = request.acrossUid;
  }
  if (!Util.isUnset(request.advancedConfig)) {
    body['AdvancedConfig'] = request.advancedConfig;
  }
  if (!Util.isUnset(request.columnsShrink)) {
    body['Columns'] = request.columnsShrink;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dirtyDataHandleMode)) {
    body['DirtyDataHandleMode'] = request.dirtyDataHandleMode;
  }
  if (!Util.isUnset(request.dirtyDataProcessPattern)) {
    body['DirtyDataProcessPattern'] = request.dirtyDataProcessPattern;
  }
  if (!Util.isUnset(request.exactlyOnce)) {
    body['ExactlyOnce'] = request.exactlyOnce;
  }
  if (!Util.isUnset(request.fullComputeUnit)) {
    body['FullComputeUnit'] = request.fullComputeUnit;
  }
  if (!Util.isUnset(request.hudiAdvancedConfig)) {
    body['HudiAdvancedConfig'] = request.hudiAdvancedConfig;
  }
  if (!Util.isUnset(request.incrementalComputeUnit)) {
    body['IncrementalComputeUnit'] = request.incrementalComputeUnit;
  }
  if (!Util.isUnset(request.lakehouseId)) {
    body['LakehouseId'] = request.lakehouseId;
  }
  if (!Util.isUnset(request.maxOffsetsPerTrigger)) {
    body['MaxOffsetsPerTrigger'] = request.maxOffsetsPerTrigger;
  }
  if (!Util.isUnset(request.ossLocation)) {
    body['OssLocation'] = request.ossLocation;
  }
  if (!Util.isUnset(request.outputFormat)) {
    body['OutputFormat'] = request.outputFormat;
  }
  if (!Util.isUnset(request.partitionSpecsShrink)) {
    body['PartitionSpecs'] = request.partitionSpecsShrink;
  }
  if (!Util.isUnset(request.password)) {
    body['Password'] = request.password;
  }
  if (!Util.isUnset(request.primaryKeyDefinition)) {
    body['PrimaryKeyDefinition'] = request.primaryKeyDefinition;
  }
  if (!Util.isUnset(request.project)) {
    body['Project'] = request.project;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    body['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.sourceRegionId)) {
    body['SourceRegionId'] = request.sourceRegionId;
  }
  if (!Util.isUnset(request.startingOffsets)) {
    body['StartingOffsets'] = request.startingOffsets;
  }
  if (!Util.isUnset(request.store)) {
    body['Store'] = request.store;
  }
  if (!Util.isUnset(request.tableName)) {
    body['TableName'] = request.tableName;
  }
  if (!Util.isUnset(request.targetGenerateRule)) {
    body['TargetGenerateRule'] = request.targetGenerateRule;
  }
  if (!Util.isUnset(request.targetType)) {
    body['TargetType'] = request.targetType;
  }
  if (!Util.isUnset(request.unixTimestampConvertShrink)) {
    body['UnixTimestampConvert'] = request.unixTimestampConvertShrink;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.workloadName)) {
    body['WorkloadName'] = request.workloadName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateApsSlsADBJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an AnalyticDB Pipeline Service (APS) job from Simple Log Service (SLS) to an AnalyticDB for MySQL Data Warehouse Edition cluster.
 *
 * @param request CreateApsSlsADBJobRequest
 * @return CreateApsSlsADBJobResponse
 */
async function createApsSlsADBJob(request: CreateApsSlsADBJobRequest): CreateApsSlsADBJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApsSlsADBJobWithOptions(request, runtime);
}

model CreateDBClusterRequest {
  backupSetId?: string(name='BackupSetId', description='The ID of the backup set that you want to use to restore data.

>  You can call the [DescribeBackups](https://help.aliyun.com/document_detail/612318.html) operation to query the backup sets of the cluster.', example='1880808684'),
  cloneSourceRegionId?: string(name='CloneSourceRegionId', description='The region ID of the source cluster.

>  This parameter must be specified for cloning clusters across regions.', example='cn-beijing'),
  computeResource?: string(name='ComputeResource', description='The amount of reserved computing resources. Valid values: 0ACU to 4096ACU. The value must be in increments of 16ACU. Each ACU is approximately equal to 1 core and 4 GB memory.

>  This parameter must be specified with a unit.', example='16ACU'),
  DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.

*   The description cannot start with `http://` or `https://`.
*   The description must be 2 to 256 characters in length', example='test'),
  DBClusterNetworkType?: string(name='DBClusterNetworkType', description='The network type of the cluster. Set the value to **VPC**.', example='VPC'),
  DBClusterVersion?: string(name='DBClusterVersion', description='The version of the cluster. Set the value to **5.0**.

This parameter is required.', example='5.0'),
  diskEncryption?: boolean(name='DiskEncryption', description='Specifies whether to enable disk encryption.', example='false'),
  enableDefaultResourcePool?: boolean(name='EnableDefaultResourcePool', description='Specifies whether to allocate all reserved computing resources to the user_default resource group. Valid values:

*   **true** (default)
*   **false**', example='true'),
  kmsId?: string(name='KmsId', description='The ID of the key that is used to encrypt disk data.

>  This parameter must be specified only when disk encryption is enabled.', example='e1935511-cf88-1123-a0f8-1be8d251****'),
  payType?: string(name='PayType', description='The billing method of the cluster. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.

This parameter is required.', example='Prepaid'),
  period?: string(name='Period', description='The subscription type of the subscription cluster. Valid values:

*   **Year**: subscription on a yearly basis.
*   **Month**: subscription on a monthly basis.

>  This parameter must be specified when PayType is set to Prepaid.', example='Month'),
  productForm?: string(name='ProductForm', description='The product form of the cluster. Valid values:

*   **IntegrationForm**: integrated.
*   **LegacyForm**: Data Lakehouse Edition.', example='LegacyForm'),
  productVersion?: string(name='ProductVersion', description='The edition of the cluster. Valid values:

*   **BasicVersion**: Basic Edition.
*   **EnterpriseVersion**: Enterprise Edition.

>  This parameter must be specified only when ProductForm is set to IntegrationForm.', example='BasicVersion'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  reservedNodeCount?: int32(name='ReservedNodeCount', description='The number of reserved resource nodes.

*   For Enterprise Edition, the default value is 3 and the step size is 3.
*   For Basic Edition, the default value is 1.

>  This parameter must be specified only when ProductForm is set to IntegrationForm.', example='3'),
  reservedNodeSize?: string(name='ReservedNodeSize', description='The specifications of reserved resource nodes. Unit: ACUs.', example='8ACU'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  restoreToTime?: string(name='RestoreToTime', description='The point in time to which you want to restore data from the backup set.', example='2023-09-20T03:13:56Z'),
  restoreType?: string(name='RestoreType', description='The method that you want to use to restore data. Valid values:

*   **backup**: restores data from a backup set. You must also specify the **BackupSetId** and **SourceDBClusterId** parameters.
*   **timepoint**: restores data to a point in time. You must also specify the **RestoreToTime** and **SourceDBClusterId** parameters.', example='backup'),
  secondaryVSwitchId?: string(name='SecondaryVSwitchId', description='The ID of the secondary vSwitch.

>  You cannot set this parameter to a value that is the same as that of the VSwitchId parameter.', example='vsw-bp1aadw9k19x451gx****'),
  secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the secondary zone.

>  You cannot set this parameter to a value that is the same as that of the ZoneId parameter.', example='cn-beijing-h'),
  sourceDbClusterId?: string(name='SourceDbClusterId', description='The ID of the source AnalyticDB for MySQL Data Warehouse Edition cluster.', example='amv-bp1r053byu48p****'),
  storageResource?: string(name='StorageResource', description='The amount of reserved storage resources. Valid values: 0ACU to 2064ACU. The value must be in increments of 24ACU. Each ACU is approximately equal to 1 core and 4 GB memory.

>  This parameter must be specified with a unit.', example='24ACU'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N to add to the cluster. You can use tags to filter clusters. Valid values of N: 1 to 20. The values that you specify for N must be unique and consecutive integers that start from 1. Each value of `Tag.N.Key` is paired with a value of `Tag.N.Value`.

>  The tag key can be up to 64 characters in length and cannot start with `aliyun`, `acs:`, `http://`, or `https://`.', example='testkey1'),
      value?: string(name='Value', description='The value of tag N to add to the cluster. You can use tags to filter clusters. Valid values of N: 1 to 20. The values that you specify for N must be unique and consecutive integers that start from 1. Each value of `Tag.N.Key` is paired with a value of `Tag.N.Value`.

>  The tag value can be up to 64 characters in length and cannot start with `aliyun`, `acs:`, `http://`, or `https://`.', example='test1'),
    }
  ](name='Tag', description='The tags to add to the cluster.'),
  usedTime?: string(name='UsedTime', description='The subscription period of the subscription cluster.

*   Valid values when Period is set to Year: 1, 2, and 3 (integer)
*   Valid values when Period is set to Month: 1 to 9 (integer)

> * This parameter is required if the PayType parameter is set to Prepaid.
> * Longer subscription periods offer more savings. Purchasing a cluster for one year is more cost-effective than purchasing the cluster for 10 or 11 months.', example='1'),
  VPCId?: string(name='VPCId', description='The virtual private cloud (VPC) ID of the cluster.

This parameter is required.', example='vpc-bp1at5ze0t5u3xtqn****'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.

This parameter is required.', example='vsw-bp1aadw9k19x6cis9****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-h'),
}

model CreateDBClusterResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp1r053byu48p****'),
  orderId?: string(name='OrderId', description='The order ID.', example='202353278****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  resourceGroupId?: string(name='ResourceGroupId', description='The default resource group ID.', example='rg-4690g37929****'),
}

model CreateDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBClusterResponseBody(name='body'),
}

/**
 * @summary Creates an AnalyticDB for MySQL Data Lakehouse Edition cluster.
 *
 * @description CreateDBCluster
 *
 * @param request CreateDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBClusterResponse
 */
async function createDBClusterWithOptions(request: CreateDBClusterRequest, runtime: Util.RuntimeOptions): CreateDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupSetId)) {
    query['BackupSetId'] = request.backupSetId;
  }
  if (!Util.isUnset(request.cloneSourceRegionId)) {
    query['CloneSourceRegionId'] = request.cloneSourceRegionId;
  }
  if (!Util.isUnset(request.computeResource)) {
    query['ComputeResource'] = request.computeResource;
  }
  if (!Util.isUnset(request.DBClusterDescription)) {
    query['DBClusterDescription'] = request.DBClusterDescription;
  }
  if (!Util.isUnset(request.DBClusterNetworkType)) {
    query['DBClusterNetworkType'] = request.DBClusterNetworkType;
  }
  if (!Util.isUnset(request.DBClusterVersion)) {
    query['DBClusterVersion'] = request.DBClusterVersion;
  }
  if (!Util.isUnset(request.diskEncryption)) {
    query['DiskEncryption'] = request.diskEncryption;
  }
  if (!Util.isUnset(request.enableDefaultResourcePool)) {
    query['EnableDefaultResourcePool'] = request.enableDefaultResourcePool;
  }
  if (!Util.isUnset(request.kmsId)) {
    query['KmsId'] = request.kmsId;
  }
  if (!Util.isUnset(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.productForm)) {
    query['ProductForm'] = request.productForm;
  }
  if (!Util.isUnset(request.productVersion)) {
    query['ProductVersion'] = request.productVersion;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.reservedNodeCount)) {
    query['ReservedNodeCount'] = request.reservedNodeCount;
  }
  if (!Util.isUnset(request.reservedNodeSize)) {
    query['ReservedNodeSize'] = request.reservedNodeSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.restoreToTime)) {
    query['RestoreToTime'] = request.restoreToTime;
  }
  if (!Util.isUnset(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  if (!Util.isUnset(request.secondaryVSwitchId)) {
    query['SecondaryVSwitchId'] = request.secondaryVSwitchId;
  }
  if (!Util.isUnset(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!Util.isUnset(request.sourceDbClusterId)) {
    query['SourceDbClusterId'] = request.sourceDbClusterId;
  }
  if (!Util.isUnset(request.storageResource)) {
    query['StorageResource'] = request.storageResource;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  if (!Util.isUnset(request.VPCId)) {
    query['VPCId'] = request.VPCId;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBCluster',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an AnalyticDB for MySQL Data Lakehouse Edition cluster.
 *
 * @description CreateDBCluster
 *
 * @param request CreateDBClusterRequest
 * @return CreateDBClusterResponse
 */
async function createDBCluster(request: CreateDBClusterRequest): CreateDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBClusterWithOptions(request, runtime);
}

model CreateDBResourceGroupRequest {
  autoStopInterval?: string(name='AutoStopInterval', example='5m'),
  clusterMode?: string(name='ClusterMode', description='A reserved parameter.', example='N/A'),
  clusterSizeResource?: string(name='ClusterSizeResource', description='A reserved parameter.', example='N/A'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  enableSpot?: boolean(name='EnableSpot', description='Specifies whether to enable the spot instance feature for the resource group. After you enable the spot instance feature, you are charged for resources at a lower unit price but the resources are probably released. You can enable the spot instance feature only for job resource groups. Valid values:

*   **True**
*   **False**', example='True'),
  engine?: string(name='Engine', example='SparkWarehouse'),
  engineParams?: map[string]any(name='EngineParams', example='{\\\\"spark.adb.version\\\\":\\\\"3.5\\\\"}'),
  groupName?: string(name='GroupName', description='The name of the resource group.

*   The name can be up to 255 characters in length.
*   The name must start with a letter or a digit.
*   The name can contain letters, digits, hyphens (_), and underscores (_).

This parameter is required.', example='test_group'),
  groupType?: string(name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

>  For more information about resource groups, see [Resource group overview](https://help.aliyun.com/document_detail/428610.html).

This parameter is required.', example='Job'),
  maxClusterCount?: int32(name='MaxClusterCount', description='A reserved parameter.', example='N/A'),
  maxComputeResource?: string(name='MaxComputeResource', description='The maximum reserved computing resources.

*   If GroupType is set to Interactive, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 16ACU.
*   If GroupType is set to Job, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 8ACU.', example='48ACU'),
  maxGpuQuantity?: int32(name='MaxGpuQuantity'),
  minClusterCount?: int32(name='MinClusterCount', description='A reserved parameter.', example='N/A'),
  minComputeResource?: string(name='MinComputeResource', description='The minimum reserved computing resources.

*   When GroupType is set to Interactive, set this parameter to 16ACU.
*   When GroupType is set to Job, set this parameter to 0ACU.', example='0ACU'),
  minGpuQuantity?: int32(name='MinGpuQuantity'),
  rayConfig?: {
    category?: string(name='Category'),
    headSpec?: string(name='HeadSpec'),
    workerGroups?: [ 
      {
        allocateUnit?: string(name='AllocateUnit'),
        groupName?: string(name='GroupName'),
        maxWorkerQuantity?: int32(name='MaxWorkerQuantity'),
        minWorkerQuantity?: int32(name='MinWorkerQuantity'),
        workerDiskCapacity?: string(name='WorkerDiskCapacity'),
        workerSpecName?: string(name='WorkerSpecName'),
        workerSpecType?: string(name='WorkerSpecType'),
      }
    ](name='WorkerGroups'),
  }(name='RayConfig'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612393.html) operation to query the most recent region list.', example='cn-hangzhou'),
  rules?: [ 
    {
      groupName?: string(name='GroupName', description='The name of the resource group.

*   The name can be up to 255 characters in length.
*   The name must start with a letter or digit.
*   The name can contain letters, digits, hyphens (-), and underscores (_).', example='test_group'),
      queryTime?: string(name='QueryTime', description='The execution duration of the query. Unit: milliseconds.', example='180000'),
      targetGroupName?: string(name='TargetGroupName', description='The name of the resource group to which you want to resubmit the query job.', example='job'),
    }
  ](name='Rules', description='The job resubmission rules.'),
  specName?: string(name='SpecName'),
  targetResourceGroupName?: string(name='TargetResourceGroupName'),
}

model CreateDBResourceGroupShrinkRequest {
  autoStopInterval?: string(name='AutoStopInterval', example='5m'),
  clusterMode?: string(name='ClusterMode', description='A reserved parameter.', example='N/A'),
  clusterSizeResource?: string(name='ClusterSizeResource', description='A reserved parameter.', example='N/A'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  enableSpot?: boolean(name='EnableSpot', description='Specifies whether to enable the spot instance feature for the resource group. After you enable the spot instance feature, you are charged for resources at a lower unit price but the resources are probably released. You can enable the spot instance feature only for job resource groups. Valid values:

*   **True**
*   **False**', example='True'),
  engine?: string(name='Engine', example='SparkWarehouse'),
  engineParamsShrink?: string(name='EngineParams', example='{\\\\"spark.adb.version\\\\":\\\\"3.5\\\\"}'),
  groupName?: string(name='GroupName', description='The name of the resource group.

*   The name can be up to 255 characters in length.
*   The name must start with a letter or a digit.
*   The name can contain letters, digits, hyphens (_), and underscores (_).

This parameter is required.', example='test_group'),
  groupType?: string(name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

>  For more information about resource groups, see [Resource group overview](https://help.aliyun.com/document_detail/428610.html).

This parameter is required.', example='Job'),
  maxClusterCount?: int32(name='MaxClusterCount', description='A reserved parameter.', example='N/A'),
  maxComputeResource?: string(name='MaxComputeResource', description='The maximum reserved computing resources.

*   If GroupType is set to Interactive, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 16ACU.
*   If GroupType is set to Job, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 8ACU.', example='48ACU'),
  maxGpuQuantity?: int32(name='MaxGpuQuantity'),
  minClusterCount?: int32(name='MinClusterCount', description='A reserved parameter.', example='N/A'),
  minComputeResource?: string(name='MinComputeResource', description='The minimum reserved computing resources.

*   When GroupType is set to Interactive, set this parameter to 16ACU.
*   When GroupType is set to Job, set this parameter to 0ACU.', example='0ACU'),
  minGpuQuantity?: int32(name='MinGpuQuantity'),
  rayConfigShrink?: string(name='RayConfig'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612393.html) operation to query the most recent region list.', example='cn-hangzhou'),
  rulesShrink?: string(name='Rules', description='The job resubmission rules.'),
  specName?: string(name='SpecName'),
  targetResourceGroupName?: string(name='TargetResourceGroupName'),
}

model CreateDBResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A94B6C02-7BD4-5D67-9776-3AC8317E8DD5'),
}

model CreateDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Creates a resource group for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param tmpReq CreateDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBResourceGroupResponse
 */
async function createDBResourceGroupWithOptions(tmpReq: CreateDBResourceGroupRequest, runtime: Util.RuntimeOptions): CreateDBResourceGroupResponse {
  Util.validateModel(tmpReq);
  var request = new CreateDBResourceGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.engineParams)) {
    request.engineParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.engineParams, 'EngineParams', 'json');
  }
  if (!Util.isUnset(tmpReq.rayConfig)) {
    request.rayConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rayConfig, 'RayConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.rules)) {
    request.rulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rules, 'Rules', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.autoStopInterval)) {
    query['AutoStopInterval'] = request.autoStopInterval;
  }
  if (!Util.isUnset(request.clusterMode)) {
    query['ClusterMode'] = request.clusterMode;
  }
  if (!Util.isUnset(request.clusterSizeResource)) {
    query['ClusterSizeResource'] = request.clusterSizeResource;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableSpot)) {
    query['EnableSpot'] = request.enableSpot;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineParamsShrink)) {
    query['EngineParams'] = request.engineParamsShrink;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupType)) {
    query['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.maxClusterCount)) {
    query['MaxClusterCount'] = request.maxClusterCount;
  }
  if (!Util.isUnset(request.maxComputeResource)) {
    query['MaxComputeResource'] = request.maxComputeResource;
  }
  if (!Util.isUnset(request.maxGpuQuantity)) {
    query['MaxGpuQuantity'] = request.maxGpuQuantity;
  }
  if (!Util.isUnset(request.minClusterCount)) {
    query['MinClusterCount'] = request.minClusterCount;
  }
  if (!Util.isUnset(request.minComputeResource)) {
    query['MinComputeResource'] = request.minComputeResource;
  }
  if (!Util.isUnset(request.minGpuQuantity)) {
    query['MinGpuQuantity'] = request.minGpuQuantity;
  }
  if (!Util.isUnset(request.rayConfigShrink)) {
    query['RayConfig'] = request.rayConfigShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.rulesShrink)) {
    query['Rules'] = request.rulesShrink;
  }
  if (!Util.isUnset(request.specName)) {
    query['SpecName'] = request.specName;
  }
  if (!Util.isUnset(request.targetResourceGroupName)) {
    query['TargetResourceGroupName'] = request.targetResourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBResourceGroup',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a resource group for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request CreateDBResourceGroupRequest
 * @return CreateDBResourceGroupResponse
 */
async function createDBResourceGroup(request: CreateDBResourceGroupRequest): CreateDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBResourceGroupWithOptions(request, runtime);
}

model CreateElasticPlanRequest {
  autoScale?: boolean(name='AutoScale', description='Specifies whether to enable **Default Proportional Scaling for EIUs**. Valid values:

*   true. In this case, storage resources are scaled along with computing resources, and the TargetSize and CronExpression parameters are not supported.
*   false

> 

*   This parameter must be specified when Type is set to WORKER. This parameter is not required when Type is set to EXECUTOR.

*   You can enable Default Proportional Scaling for EIUs for only a single scaling plan of a cluster.', example='false'),
  cronExpression?: string(name='CronExpression', description='A CORN expression that specifies the scaling cycle and time for the scaling plan.', example='0 20 14 * * ?'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

>  The name must be 2 to 30 characters in length and can contain letters, digits, and underscores (_). The name must start with a letter.

This parameter is required.', example='test'),
  enabled?: boolean(name='Enabled', description='Specifies whether to immediately enable the scaling plan after the plan is created. Valid values:

*   true
*   false

This parameter is required.', example='true'),
  endTime?: string(name='EndTime', description='The end time of the scaling plan.

>  Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2025-01-01T12:01:00Z'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

> 

*   If you want to create a scaling plan that uses interactive resource groups, you must specify this parameter. If you want to create a scaling plan that uses elastic I/O units (EIUs), you do not need to specify this parameter.

*   You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the resource group name for a cluster.', example='test'),
  startTime?: string(name='StartTime', description='The start time of the scaling plan.

>  Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-01-01T12:01:00Z'),
  targetSize?: string(name='TargetSize', description='The desired specifications of elastic resources after scaling.

> 

*   If the scaling plan uses **EIUs** and **Default Proportional Scaling for EIUs** is enabled, you do not need to specify this parameter. In other cases, you must specify this parameter.

*   You can call the [DescribeElasticPlanSpecifications](https://help.aliyun.com/document_detail/601278.html) operation to query the specifications that are supported for scaling plans.', example='32ACU'),
  type?: string(name='Type', description='The type of the scaling plan. Valid values:

*   EXECUTOR: the interactive resource group type, which indicates the computing resource type.
*   WORKER: the EIU type.

This parameter is required.', example='EXECUTOR'),
}

model CreateElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
}

model CreateElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateElasticPlanResponseBody(name='body'),
}

/**
 * @summary Creates a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateElasticPlanResponse
 */
async function createElasticPlanWithOptions(request: CreateElasticPlanRequest, runtime: Util.RuntimeOptions): CreateElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoScale)) {
    query['AutoScale'] = request.autoScale;
  }
  if (!Util.isUnset(request.cronExpression)) {
    query['CronExpression'] = request.cronExpression;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.targetSize)) {
    query['TargetSize'] = request.targetSize;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateElasticPlan',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request CreateElasticPlanRequest
 * @return CreateElasticPlanResponse
 */
async function createElasticPlan(request: CreateElasticPlanRequest): CreateElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createElasticPlanWithOptions(request, runtime);
}

model CreateLakeStorageRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.
You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='******'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster with which you want to associate the lake storage.', example='amv-******'),
  description?: string(name='Description', description='The description of the lake storage.', example='test'),
  permissions?: [ 
    {
      account?: string(name='Account', description='The account ID.', example='-'),
      read?: boolean(name='Read', description='The read permissions.', example='-'),
      type?: string(name='Type', description='The account type.', example='-'),
      write?: boolean(name='Write', description='The write permissions.', example='-'),
    }
  ](name='Permissions', description='The permissions that you want to grant on the lake storage to the Alibaba Cloud account besides the permissions that are automatically granted to the Resource Access Management (RAM) user or the Alibaba Cloud account.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model CreateLakeStorageShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.
You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='******'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster with which you want to associate the lake storage.', example='amv-******'),
  description?: string(name='Description', description='The description of the lake storage.', example='test'),
  permissionsShrink?: string(name='Permissions', description='The permissions that you want to grant on the lake storage to the Alibaba Cloud account besides the permissions that are automatically granted to the Resource Access Management (RAM) user or the Alibaba Cloud account.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model CreateLakeStorageResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  data?: string(name='Data', description='The usage details of cluster resources.', example='true'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the operation is asynchronously implemented, the job ID is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID', example='******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateLakeStorageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLakeStorageResponseBody(name='body'),
}

/**
 * @summary Creates a lake storage.
 *
 * @param tmpReq CreateLakeStorageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLakeStorageResponse
 */
async function createLakeStorageWithOptions(tmpReq: CreateLakeStorageRequest, runtime: Util.RuntimeOptions): CreateLakeStorageResponse {
  Util.validateModel(tmpReq);
  var request = new CreateLakeStorageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.permissions)) {
    request.permissionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.permissions, 'Permissions', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.permissionsShrink)) {
    body['Permissions'] = request.permissionsShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateLakeStorage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a lake storage.
 *
 * @param request CreateLakeStorageRequest
 * @return CreateLakeStorageResponse
 */
async function createLakeStorage(request: CreateLakeStorageRequest): CreateLakeStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLakeStorageWithOptions(request, runtime);
}

model CreateOssSubDirectoryRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the information about all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region, including cluster IDs.

This parameter is required.', example='amv-bp149vz49b36t****'),
  path?: string(name='Path', description='The OSS path where you want to create a subdirectory.

This parameter is required.', example='oss://testBucketName/das_lakehouse'),
}

model CreateOssSubDirectoryResponseBody = {
  data?: {
    clientCRC?: long(name='ClientCRC', description='The cyclic redundancy check (CRC) value on the client.', example='1'),
    ETag?: string(name='ETag', description='The tag of the OSS path.', example='1'),
    requestId?: string(name='RequestId', description='The request ID.', example='3A0DE2E0-A37B-5EE4-9136-C4C473714802'),
    serverCRC?: long(name='ServerCRC', description='The CRC-64 value on the OSS bucket.', example='1'),
  }(name='Data', description='The returned data.'),
  httpStatusCode?: long(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.

*   If the request was successful, a **success** message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='3A0DE2E0-A37B-5EE4-9136-C4C473714802'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
}

model CreateOssSubDirectoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOssSubDirectoryResponseBody(name='body'),
}

/**
 * @summary Creates an Object Storage Service (OSS) subdirectory.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request CreateOssSubDirectoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOssSubDirectoryResponse
 */
async function createOssSubDirectoryWithOptions(request: CreateOssSubDirectoryRequest, runtime: Util.RuntimeOptions): CreateOssSubDirectoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.path)) {
    body['Path'] = request.path;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateOssSubDirectory',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an Object Storage Service (OSS) subdirectory.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request CreateOssSubDirectoryRequest
 * @return CreateOssSubDirectoryResponse
 */
async function createOssSubDirectory(request: CreateOssSubDirectoryRequest): CreateOssSubDirectoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOssSubDirectoryWithOptions(request, runtime);
}

model CreatePerformanceViewRequest {
  createFromViewType?: string(name='CreateFromViewType', description='The type of the view.', example='Basic'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-bp1ub9grke1****'),
  fillOriginViewKeys?: boolean(name='FillOriginViewKeys', description='Specifies whether to populate the names of the metrics in the original monitoring view when you view the monitoring view. Valid values:

*   **true**
*   **false**', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  viewDetail?: {
    categories?: [ 
      {
        category?: string(name='Category', description='The name of the metric category. Valid values:

*   **Node**
*   **DiskData**
*   **WorkLoad**
*   **ResourceGroup**', example='Node'),
        keys?: [ 
          {
            keyName?: string(name='KeyName', description='The name of the metric.', example='AnalyticDB_CPU'),
            selected?: boolean(name='Selected', description='Specifies whether to select the metric. Valid values:

*   **true**
*   **false**', example='true'),
          }
        ](name='Keys', description='The metrics.'),
      }
    ](name='Categories', description='The metric categories.'),
    chartLinked?: boolean(name='ChartLinked', description='Specifies whether to enable the filter interaction feature. Valid values:

*   **true**
*   **false**', example='true'),
    chartsPerLine?: int32(name='ChartsPerLine', description='The number of charts to display in each row.', example='2'),
  }(name='ViewDetail', description='The information about the monitoring view.

This parameter is required.'),
  viewName?: string(name='ViewName', description='The name of the view.

This parameter is required.', example='viewname'),
}

model CreatePerformanceViewShrinkRequest {
  createFromViewType?: string(name='CreateFromViewType', description='The type of the view.', example='Basic'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-bp1ub9grke1****'),
  fillOriginViewKeys?: boolean(name='FillOriginViewKeys', description='Specifies whether to populate the names of the metrics in the original monitoring view when you view the monitoring view. Valid values:

*   **true**
*   **false**', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  viewDetailShrink?: string(name='ViewDetail', description='The information about the monitoring view.

This parameter is required.'),
  viewName?: string(name='ViewName', description='The name of the view.

This parameter is required.', example='viewname'),
}

model CreatePerformanceViewResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.

>  This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  createStatus?: string(name='CreateStatus', description='The creation result. Valid values:

*   **SUCCESS**
*   **FAILED**', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='E031AABF-BD56-5966-A063-4283EF18DB45'),
}

model CreatePerformanceViewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePerformanceViewResponseBody(name='body'),
}

/**
 * @summary Creates a custom monitoring view.
 *
 * @param tmpReq CreatePerformanceViewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePerformanceViewResponse
 */
async function createPerformanceViewWithOptions(tmpReq: CreatePerformanceViewRequest, runtime: Util.RuntimeOptions): CreatePerformanceViewResponse {
  Util.validateModel(tmpReq);
  var request = new CreatePerformanceViewShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.viewDetail)) {
    request.viewDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.viewDetail, 'ViewDetail', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.createFromViewType)) {
    query['CreateFromViewType'] = request.createFromViewType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.fillOriginViewKeys)) {
    query['FillOriginViewKeys'] = request.fillOriginViewKeys;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.viewDetailShrink)) {
    query['ViewDetail'] = request.viewDetailShrink;
  }
  if (!Util.isUnset(request.viewName)) {
    query['ViewName'] = request.viewName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePerformanceView',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a custom monitoring view.
 *
 * @param request CreatePerformanceViewRequest
 * @return CreatePerformanceViewResponse
 */
async function createPerformanceView(request: CreatePerformanceViewRequest): CreatePerformanceViewResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPerformanceViewWithOptions(request, runtime);
}

model CreateSparkTemplateRequest {
  appType?: string(name='AppType', description='The application type. Valid values:

*   **SQL**
*   **STREAMING**
*   **BATCH**

>  You do not need to specify this parameter when Type is set to folder.', example='SQL'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  name?: string(name='Name', description='The name of the application template. The name can be up to 64 characters in length.

This parameter is required.', example='batchfile'),
  parentId?: long(name='ParentId', description='The ID of the directory to which the application template belongs.

>  You can call the [GetSparkTemplateFolderTree](https://help.aliyun.com/document_detail/456218.html) operation to query the directory ID.

This parameter is required.', example='10'),
  type?: string(name='Type', description='The type of the application template. Valid values:

*   **folder**: directory.
*   **file**: application.

This parameter is required.', example='file'),
}

model CreateSparkTemplateResponseBody = {
  data?: {
    succeeded?: boolean(name='Succeeded', description='Indicates whether the application template is created. Valid values:

*   **True**
*   **False**', example='True'),
  }(name='Data', description='The creation result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model CreateSparkTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSparkTemplateResponseBody(name='body'),
}

/**
 * @summary Creates a Spark application template.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request CreateSparkTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSparkTemplateResponse
 */
async function createSparkTemplateWithOptions(request: CreateSparkTemplateRequest, runtime: Util.RuntimeOptions): CreateSparkTemplateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appType)) {
    body['AppType'] = request.appType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.parentId)) {
    body['ParentId'] = request.parentId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSparkTemplate',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a Spark application template.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request CreateSparkTemplateRequest
 * @return CreateSparkTemplateResponse
 */
async function createSparkTemplate(request: CreateSparkTemplateRequest): CreateSparkTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSparkTemplateWithOptions(request, runtime);
}

model DeleteAccountRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

>  You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/612430.html) operation to query the information about database accounts for a cluster, including the account name.

This parameter is required.', example='test_accout'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
}

model DeleteAccountResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2FED790E-FB61-4721-8C1C-07C627FA5A19'),
}

model DeleteAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAccountResponseBody(name='body'),
}

/**
 * @summary Deletes a database account from an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAccountResponse
 */
async function deleteAccountWithOptions(request: DeleteAccountRequest, runtime: Util.RuntimeOptions): DeleteAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAccount',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a database account from an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteAccountRequest
 * @return DeleteAccountResponse
 */
async function deleteAccount(request: DeleteAccountRequest): DeleteAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAccountWithOptions(request, runtime);
}

model DeleteApsDatasoureRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

This parameter is required.', example='amv-******'),
  datasourceId?: long(name='DatasourceId', description='The data source ID.

This parameter is required.', example='1'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteApsDatasoureResponseBody = {
  code?: string(name='Code', description='The response code.', example='200'),
  data?: string(name='Data', description='The returned data.', example='7'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='FAE98A4F-****-****-BF6D-67EEAC9C39DE'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   **True**
*   **False**', example='True'),
}

model DeleteApsDatasoureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApsDatasoureResponseBody(name='body'),
}

/**
 * @summary Deletes an AnalyticDB Pipeline Service (APS) data source.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteApsDatasoureRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteApsDatasoureResponse
 */
async function deleteApsDatasoureWithOptions(request: DeleteApsDatasoureRequest, runtime: Util.RuntimeOptions): DeleteApsDatasoureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApsDatasoure',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an AnalyticDB Pipeline Service (APS) data source.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteApsDatasoureRequest
 * @return DeleteApsDatasoureResponse
 */
async function deleteApsDatasoure(request: DeleteApsDatasoureRequest): DeleteApsDatasoureResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApsDatasoureWithOptions(request, runtime);
}

model DeleteApsJobRequest {
  apsJobId?: string(name='ApsJobId', description='The job ID.

This parameter is required.', example='aps-*****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteApsJobResponseBody = {
  apsJobId?: string(name='ApsJobId', description='The job ID.', example='aps-*****'),
  code?: string(name='Code', description='The HTTP status code or the error code.', example='200'),
  errCode?: string(name='ErrCode', description='The error code returned when the request fails.', example='Success'),
  errMessage?: string(name='ErrMessage', description='The error code returned when the request fails.', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='****-****-5D14-AC9F-*********'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='True'),
}

model DeleteApsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApsJobResponseBody(name='body'),
}

/**
 * @summary Deletes an AnalyticDB Pipeline Service (APS) job.
 *
 * @description *   Deleting backup sets is an asynchronous operation and may require 10 to 20 minutes to complete.
 * *   You can delete up to 100 backup sets at a time. If you want to delete more than 100 backup sets, call this operation twice.
 * *   To ensure data security, the system forcibly retains one valid backup set. If you want to delete the last backup set, the system prohibits your operation.
 *
 * @param request DeleteApsJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteApsJobResponse
 */
async function deleteApsJobWithOptions(request: DeleteApsJobRequest, runtime: Util.RuntimeOptions): DeleteApsJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apsJobId)) {
    body['ApsJobId'] = request.apsJobId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApsJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an AnalyticDB Pipeline Service (APS) job.
 *
 * @description *   Deleting backup sets is an asynchronous operation and may require 10 to 20 minutes to complete.
 * *   You can delete up to 100 backup sets at a time. If you want to delete more than 100 backup sets, call this operation twice.
 * *   To ensure data security, the system forcibly retains one valid backup set. If you want to delete the last backup set, the system prohibits your operation.
 *
 * @param request DeleteApsJobRequest
 * @return DeleteApsJobResponse
 */
async function deleteApsJob(request: DeleteApsJobRequest): DeleteApsJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApsJobWithOptions(request, runtime);
}

model DeleteBackupsRequest {
  backupIds?: string(name='BackupIds', description='The ID of the backup set that you want to delete. Separate multiple backup set IDs with commas (,).

This parameter is required.', example='763,764'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

This parameter is required.', example='amv-uf6g8w25jacm7****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteBackupsResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='771C5FAA-530F-52F7-B84D-EBAD4561D590'),
}

model DeleteBackupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBackupsResponseBody(name='body'),
}

/**
 * @summary Manually deletes backup sets.
 *
 * @description *   You can delete up to 100 backup sets at a time. If you want to delete more than 100 backup sets, call this operation twice.
 * *   To ensure data security, the system forcibly retains one valid backup set. If you want to delete the last backup set, the system prohibits your operation.
 *
 * @param request DeleteBackupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBackupsResponse
 */
async function deleteBackupsWithOptions(request: DeleteBackupsRequest, runtime: Util.RuntimeOptions): DeleteBackupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupIds)) {
    query['BackupIds'] = request.backupIds;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBackups',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Manually deletes backup sets.
 *
 * @description *   You can delete up to 100 backup sets at a time. If you want to delete more than 100 backup sets, call this operation twice.
 * *   To ensure data security, the system forcibly retains one valid backup set. If you want to delete the last backup set, the system prohibits your operation.
 *
 * @param request DeleteBackupsRequest
 * @return DeleteBackupsResponse
 */
async function deleteBackups(request: DeleteBackupsRequest): DeleteBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBackupsWithOptions(request, runtime);
}

model DeleteDBClusterRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-bp1r053byu48p****'),
}

model DeleteDBClusterResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.', example='amv-bp1r053byu48p****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DeleteDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBClusterResponseBody(name='body'),
}

/**
 * @summary Deletes an AnalyticDB for MySQL cluster.
 *
 * @description ### [](#)
 * *   You can delete only pay-as-you-go clusters.
 * *   The cluster that you want to delete must be in the Running state.
 * *   For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBClusterResponse
 */
async function deleteDBClusterWithOptions(request: DeleteDBClusterRequest, runtime: Util.RuntimeOptions): DeleteDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBCluster',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an AnalyticDB for MySQL cluster.
 *
 * @description ### [](#)
 * *   You can delete only pay-as-you-go clusters.
 * *   The cluster that you want to delete must be in the Running state.
 * *   For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteDBClusterRequest
 * @return DeleteDBClusterResponse
 */
async function deleteDBCluster(request: DeleteDBClusterRequest): DeleteDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBClusterWithOptions(request, runtime);
}

model DeleteDBResourceGroupRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/612410.html) operation to query the information about resource groups of an AnalyticDB for MySQL cluster, including resource group names.

This parameter is required.', example='test_group'),
}

model DeleteDBResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A94B6C02-7BD4-5D67-9776-3AC8317E8DD3'),
}

model DeleteDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a resource group from an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBResourceGroupResponse
 */
async function deleteDBResourceGroupWithOptions(request: DeleteDBResourceGroupRequest, runtime: Util.RuntimeOptions): DeleteDBResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBResourceGroup',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a resource group from an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteDBResourceGroupRequest
 * @return DeleteDBResourceGroupResponse
 */
async function deleteDBResourceGroup(request: DeleteDBResourceGroupRequest): DeleteDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBResourceGroupWithOptions(request, runtime);
}

model DeleteElasticPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

>  You can call the [DescribeElasticPlans](https://help.aliyun.com/document_detail/601334.html) operation to query the names of scaling plans.

This parameter is required.', example='test'),
}

model DeleteElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
}

model DeleteElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteElasticPlanResponseBody(name='body'),
}

/**
 * @summary Deletes a scaling plan from an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteElasticPlanResponse
 */
async function deleteElasticPlanWithOptions(request: DeleteElasticPlanRequest, runtime: Util.RuntimeOptions): DeleteElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteElasticPlan',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a scaling plan from an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteElasticPlanRequest
 * @return DeleteElasticPlanResponse
 */
async function deleteElasticPlan(request: DeleteElasticPlanRequest): DeleteElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteElasticPlanWithOptions(request, runtime);
}

model DeleteLakeStorageRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.', example='amv-bp*********'),
  lakeStorageId?: string(name='LakeStorageId', description='The ID of the lake storage.

This parameter is required.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
}

model DeleteLakeStorageResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful. Other status codes indicate that the request failed.', example='200'),
  data?: string(name='Data', description='Indicates whether the delete operation was successful.', example='True'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message. If the operation is asynchronously implemented, the job ID is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='2******-B2C1-408E-AA73-DB8D59******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model DeleteLakeStorageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLakeStorageResponseBody(name='body'),
}

/**
 * @summary Deletes a lake storage.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteLakeStorageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLakeStorageResponse
 */
async function deleteLakeStorageWithOptions(request: DeleteLakeStorageRequest, runtime: Util.RuntimeOptions): DeleteLakeStorageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.lakeStorageId)) {
    body['LakeStorageId'] = request.lakeStorageId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLakeStorage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a lake storage.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DeleteLakeStorageRequest
 * @return DeleteLakeStorageResponse
 */
async function deleteLakeStorage(request: DeleteLakeStorageRequest): DeleteLakeStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLakeStorageWithOptions(request, runtime);
}

model DeletePerformanceViewRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  viewName?: string(name='ViewName', description='The name of the view.

This parameter is required.', example='view_dwd_plan_double_term'),
}

model DeletePerformanceViewResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.

>  This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  deleteStatus?: boolean(name='DeleteStatus', description='The delete status.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DeletePerformanceViewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePerformanceViewResponseBody(name='body'),
}

/**
 * @summary Deletes a monitoring view.
 *
 * @param request DeletePerformanceViewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePerformanceViewResponse
 */
async function deletePerformanceViewWithOptions(request: DeletePerformanceViewRequest, runtime: Util.RuntimeOptions): DeletePerformanceViewResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.viewName)) {
    query['ViewName'] = request.viewName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePerformanceView',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a monitoring view.
 *
 * @param request DeletePerformanceViewRequest
 * @return DeletePerformanceViewResponse
 */
async function deletePerformanceView(request: DeletePerformanceViewRequest): DeletePerformanceViewResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePerformanceViewWithOptions(request, runtime);
}

model DeleteSparkTemplateRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  id?: long(name='Id', description='The directory ID of the template files that you want to delete.

> 

*   You can call the [GetSparkTemplateFullTree](https://help.aliyun.com/document_detail/456205.html) operation to query the directory ID of template files.

*   When you specify a directory ID, the directory and all template files that are included in the directory are deleted.

This parameter is required.', example='725204'),
}

model DeleteSparkTemplateResponseBody = {
  data?: {
    succeeded?: boolean(name='Succeeded', description='Indicates whether the request was successful. Valid values:

*   **True**
*   **False**', example='True'),
  }(name='Data', description='The returned result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DeleteSparkTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSparkTemplateResponseBody(name='body'),
}

/**
 * @summary Deletes Spark template files.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request DeleteSparkTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSparkTemplateResponse
 */
async function deleteSparkTemplateWithOptions(request: DeleteSparkTemplateRequest, runtime: Util.RuntimeOptions): DeleteSparkTemplateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSparkTemplate',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes Spark template files.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request DeleteSparkTemplateRequest
 * @return DeleteSparkTemplateResponse
 */
async function deleteSparkTemplate(request: DeleteSparkTemplateRequest): DeleteSparkTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSparkTemplateWithOptions(request, runtime);
}

model DeleteSparkTemplateFileRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1y769u11748****'),
  id?: long(name='Id', description='The ID of the template file to be deleted.

>  You can call the [GetSparkTemplateFullTree](https://help.aliyun.com/document_detail/456205.html) operation to query all template file IDs.

This parameter is required.', example='284'),
}

model DeleteSparkTemplateFileResponseBody = {
  data?: {
    succeeded?: boolean(name='Succeeded', description='Indicates whether the template file is deleted. Valid values:

*   **true**
*   **false**', example='true'),
  }(name='Data', description='The deletion result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C3A9594F-1D40-4472-A96C-8FB8AA20D38C'),
}

model DeleteSparkTemplateFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSparkTemplateFileResponseBody(name='body'),
}

/**
 * @summary Deletes Spark template files.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request DeleteSparkTemplateFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSparkTemplateFileResponse
 */
async function deleteSparkTemplateFileWithOptions(request: DeleteSparkTemplateFileRequest, runtime: Util.RuntimeOptions): DeleteSparkTemplateFileResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSparkTemplateFile',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes Spark template files.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request DeleteSparkTemplateFileRequest
 * @return DeleteSparkTemplateFileResponse
 */
async function deleteSparkTemplateFile(request: DeleteSparkTemplateFileRequest): DeleteSparkTemplateFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSparkTemplateFileWithOptions(request, runtime);
}

model DescribeAPSADBInstancesRequest {
  pageNumber?: int32(name='PageNumber', description='The page number.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

This parameter is required.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAPSADBInstancesResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='0'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  items?: [ 
    {
      computeResource?: string(name='ComputeResource', description='The specifications of the reserved computing resources.', example='16ACU'),
      DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.', example='adb_test'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='am-bp1********'),
      DBClusterStatus?: string(name='DBClusterStatus', description='The status of the cluster.', example='Running'),
      reservedACU?: string(name='ReservedACU', description='The amount of remaining reserved computing resources that are available in the cluster.', example='24ACU'),
      storageResource?: long(name='StorageResource', description='The specifications of the reserved storage resources.', example='24ACU'),
      zoneId?: string(name='ZoneId', description='The zone ID of the cluster.', example='cn-hangzhou-h'),
    }
  ](name='Items', description='The queried clusters.', example='-'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='Success'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='100'),
}

model DescribeAPSADBInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAPSADBInstancesResponseBody(name='body'),
}

/**
 * @summary Queries a list of AnalyticDB for MySQL clusters for AnalyticDB Pipeline Service (APS) federated analytics.
 *
 * @description You can call this operation to query the performance data of a cluster over a time range based on performance metrics. The collection granularity is 30 seconds. This operation allows you to query information about slow queries, such as the SQL query duration, number of scanned rows, and amount of scanned data.
 *
 * @param request DescribeAPSADBInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAPSADBInstancesResponse
 */
async function describeAPSADBInstancesWithOptions(request: DescribeAPSADBInstancesRequest, runtime: Util.RuntimeOptions): DescribeAPSADBInstancesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAPSADBInstances',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of AnalyticDB for MySQL clusters for AnalyticDB Pipeline Service (APS) federated analytics.
 *
 * @description You can call this operation to query the performance data of a cluster over a time range based on performance metrics. The collection granularity is 30 seconds. This operation allows you to query information about slow queries, such as the SQL query duration, number of scanned rows, and amount of scanned data.
 *
 * @param request DescribeAPSADBInstancesRequest
 * @return DescribeAPSADBInstancesResponse
 */
async function describeAPSADBInstances(request: DescribeAPSADBInstancesRequest): DescribeAPSADBInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAPSADBInstancesWithOptions(request, runtime);
}

model DescribeAbnormalPatternDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-xxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2024-11-17T02:16Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-zhangjiakou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2021-09-30T00:10Z'),
}

model DescribeAbnormalPatternDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-xxxx'),
  detectionItems?: [ 
    {
      name?: string(name='Name', description='The name of the detection item.', example='Cost'),
      results?: [ 
        {
          accessIp?: string(name='AccessIp', description='The IP address of the SQL client that submits the SQL pattern.', example='172.16.133.168'),
          detail?: string(name='Detail', description='The description of the detection result.', example='Two SQL patterns that have abnormal totalTime metric values are detected. This may result in increased CPU utilization, query slowdown, and degraded system stability. Go to the monitoring page to diagnose the issue and then perform optimization.'),
          failedCount?: long(name='FailedCount', description='The number of failed SQL patterns within the time range.', example='7'),
          patternId?: string(name='PatternId', description='The SQL pattern ID.', example='2803084667741875187'),
          queryCount?: long(name='QueryCount', description='The number of queries.', example='72'),
          relatedMetrics?: string(name='RelatedMetrics', description='The metrics related to the SQL pattern.', example='Maximum query duration: 1.43s
Maximum peak memory: 20.73 MB
Maximum read table data: 10.12 MB'),
          SQLPattern?: string(name='SQLPattern', description='The SQL statement that represents the SQL pattern.', example='SELECT `tsid`nFROM `prod_ods_marketing_engine_material`nWHERE `tsid` = ?nLIMIT ?'),
          tables?: string(name='Tables', description='The names of tables.', example='dw_student_exam.ods_school_queanal'),
          user?: string(name='User', description='The name of the database account that is used to submit the query.', example='test'),
        }
      ](name='Results', description='The detection result items.'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='19B824E0-690D-5A78-9992-5398C2F43694'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='15'),
}

model DescribeAbnormalPatternDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAbnormalPatternDetectionResponseBody(name='body'),
}

/**
 * @summary Queries abnormal SQL patterns within a time range.
 *
 * @param request DescribeAbnormalPatternDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAbnormalPatternDetectionResponse
 */
async function describeAbnormalPatternDetectionWithOptions(request: DescribeAbnormalPatternDetectionRequest, runtime: Util.RuntimeOptions): DescribeAbnormalPatternDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAbnormalPatternDetection',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries abnormal SQL patterns within a time range.
 *
 * @param request DescribeAbnormalPatternDetectionRequest
 * @return DescribeAbnormalPatternDetectionResponse
 */
async function describeAbnormalPatternDetection(request: DescribeAbnormalPatternDetectionRequest): DescribeAbnormalPatternDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAbnormalPatternDetectionWithOptions(request, runtime);
}

model DescribeAccountAllPrivilegesRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

This parameter is required.', example='account1'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp14t95lun0w****'),
  marker?: string(name='Marker', description='Specifies the start position marker from which to return results. If you receive a response indicating that the results are truncated, set this parameter to the value of the `Marker` parameter in the response that you received.', example='EXAMPLE'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAccountAllPrivilegesResponseBody = {
  data?: {
    marker?: string(name='Marker', description='Indicates the position where the results are truncated. When a value of `true` is returned for the `Truncated` parameter, this parameter is present and contains the value to use for the Marker parameter in a subsequent call.', example='0573e74fd1ccb01739993a691e876074db6e1b6ad79f54115f0e98528432ba6a523cfec5780ade5189299cc3396f6ff7'),
    result?: [ 
      {
        privilegeObject?: {
          column?: string(name='Column', description='The name of the column.', example='id'),
          database?: string(name='Database', description='The name of the database.', example='tdb1'),
          description?: string(name='Description', description='The description of the permission object.', example='id of table'),
          table?: string(name='Table', description='The name of the table.', example='table1'),
        }(name='PrivilegeObject', description='The objects on which the permission takes effect, including databases, tables, and columns. If Global is returned for the PrivilegeType parameter, an empty string is returned for this parameter.'),
        privilegeType?: string(name='PrivilegeType', description='The permission level of the database account. You can call the `DescribeEnabledPrivileges` operation to query the permission level of the database account.', example='Global'),
        privileges?: [ string ](name='Privileges', description='The name of the permission, which is the same as the permission name returned by the `DescribeEnabledPrivileges` operation.'),
      }
    ](name='Result', description='The permissions.'),
    truncated?: boolean(name='Truncated', description='Indicates whether the results are truncated. If the results are truncated, a value of `true` is returned. In this case, you must call this operation again to obtain all the results until a value of `false` is returned for this parameter.', example='true'),
  }(name='Data', description='Details of the permissions.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3BB185E9-BB54-1727-B876-13243E4C0EB5'),
}

model DescribeAccountAllPrivilegesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountAllPrivilegesResponseBody(name='body'),
}

/**
 * @summary Queries the permissions of a database account on all permission levels.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAccountAllPrivilegesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountAllPrivilegesResponse
 */
async function describeAccountAllPrivilegesWithOptions(request: DescribeAccountAllPrivilegesRequest, runtime: Util.RuntimeOptions): DescribeAccountAllPrivilegesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.marker)) {
    query['Marker'] = request.marker;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAccountAllPrivileges',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the permissions of a database account on all permission levels.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAccountAllPrivilegesRequest
 * @return DescribeAccountAllPrivilegesResponse
 */
async function describeAccountAllPrivileges(request: DescribeAccountAllPrivilegesRequest): DescribeAccountAllPrivilegesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountAllPrivilegesWithOptions(request, runtime);
}

model DescribeAccountPrivilegeObjectsRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

This parameter is required.', example='test'),
  columnPrivilegeObject?: string(name='ColumnPrivilegeObject', description='The column name that is used to filter columns.', example='col1'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1k3wdmt139****'),
  databasePrivilegeObject?: string(name='DatabasePrivilegeObject', description='The database name that is used to filter databases.', example='database1'),
  pageNumber?: string(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page. Default value: 20.', example='20'),
  privilegeType?: string(name='PrivilegeType', description='The permission level. Valid values: Database, Table, and Column. Global is not supported.', example='Column'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='ch-hangzhou'),
  tablePrivilegeObject?: string(name='TablePrivilegeObject', description='The table name that is used to filter tables.', example='table1'),
}

model DescribeAccountPrivilegeObjectsResponseBody = {
  data?: [ 
    {
      column?: string(name='Column', description='The name of the column. This parameter is returned when PrivilegeType is set to Column.', example='column1'),
      database?: string(name='Database', description='The name of the database. This parameter is returned when PrivilegeType is set to Database, Table, or Column.', example='tdb1'),
      description?: string(name='Description', description='The description that is specified when you create a table or column. This parameter is returned only when PrivilegeType is set to Database or Table, indicating the database description or table description.', example='a test db'),
      table?: string(name='Table', description='The name of the table. This parameter is returned when PrivilegeType is set to Table or Column.', example='table1'),
    }
  ](name='Data', description='The permissions.'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
  requestId?: string(name='RequestId', description='The request ID.', example='34B2AD29-682F-1C14-B3AA-9EF1A96084B8'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='23'),
}

model DescribeAccountPrivilegeObjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountPrivilegeObjectsResponseBody(name='body'),
}

/**
 * @summary Queries the databases, tables, and columns on which a database account has permissions.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAccountPrivilegeObjectsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountPrivilegeObjectsResponse
 */
async function describeAccountPrivilegeObjectsWithOptions(request: DescribeAccountPrivilegeObjectsRequest, runtime: Util.RuntimeOptions): DescribeAccountPrivilegeObjectsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.columnPrivilegeObject)) {
    query['ColumnPrivilegeObject'] = request.columnPrivilegeObject;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.databasePrivilegeObject)) {
    query['DatabasePrivilegeObject'] = request.databasePrivilegeObject;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.privilegeType)) {
    query['PrivilegeType'] = request.privilegeType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tablePrivilegeObject)) {
    query['TablePrivilegeObject'] = request.tablePrivilegeObject;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAccountPrivilegeObjects',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the databases, tables, and columns on which a database account has permissions.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAccountPrivilegeObjectsRequest
 * @return DescribeAccountPrivilegeObjectsResponse
 */
async function describeAccountPrivilegeObjects(request: DescribeAccountPrivilegeObjectsRequest): DescribeAccountPrivilegeObjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountPrivilegeObjectsWithOptions(request, runtime);
}

model DescribeAccountPrivilegesRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

This parameter is required.', example='account1'),
  columnPrivilegeObject?: string(name='ColumnPrivilegeObject', description='The columns that you want to query. You can use this parameter to query the permissions of the database account on specific columns. This parameter is available only if the PrivilegeType parameter is set to Column.', example='col1'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp1k5p066e1a****'),
  databasePrivilegeObject?: string(name='DatabasePrivilegeObject', description='The databases that you want to query. You can use this parameter to query the permissions of the database account on specific databases. This parameter is available only if the PrivilegeType parameter is set to Database, Table, or Column.', example='db1'),
  pageNumber?: string(name='PageNumber', description='The number of the page to return. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries to return on each page. Default value: 20.', example='10'),
  privilegeType?: string(name='PrivilegeType', description='The permission level that you want to query. You can call the `DescribeEnabledPrivileges` operation to query the permission level of the database account.', example='Global'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  tablePrivilegeObject?: string(name='TablePrivilegeObject', description='The tables that you want to query. You can use this parameter to query the permissions of the database account on specific tables. This parameter can be used together with the DatabasePrivilegeObject parameter. This parameter is available only if the PrivilegeType parameter is set to Table or Column.', example='table1'),
}

model DescribeAccountPrivilegesResponseBody = {
  data?: [ 
    {
      privilegeObject?: {
        column?: string(name='Column', description='The name of the column.', example='column1'),
        database?: string(name='Database', description='The name of the database.', example='db1'),
        description?: string(name='Description', description='The description of the permission object.', example='a test column'),
        table?: string(name='Table', description='The name of the table.', example='tabl1'),
      }(name='PrivilegeObject', description='The objects on which the permission takes effect, including databases, tables, columns, and additional descriptions.'),
      privilegeType?: string(name='PrivilegeType', description='The permission level of the permission. Valid values: `Global`, `Database`, `Table`, and `Column`. You can call the `DescribeEnabledPrivileges` parameter to query the permission level of a specific permission.', example='Column'),
      privileges?: [ string ](name='Privileges', description='The name of the permission. You can call the `DescribeEnabledPrivileges` operation to query the name of the permission.'),
    }
  ](name='Data', description='Details of the permissions.'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='20'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DA32480A-E3E5-1BE7-BA98-724551DC04C8'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='100'),
}

model DescribeAccountPrivilegesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountPrivilegesResponseBody(name='body'),
}

/**
 * @summary 获取某一ADB账户的权限
 *
 * @param request DescribeAccountPrivilegesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountPrivilegesResponse
 */
async function describeAccountPrivilegesWithOptions(request: DescribeAccountPrivilegesRequest, runtime: Util.RuntimeOptions): DescribeAccountPrivilegesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.columnPrivilegeObject)) {
    query['ColumnPrivilegeObject'] = request.columnPrivilegeObject;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.databasePrivilegeObject)) {
    query['DatabasePrivilegeObject'] = request.databasePrivilegeObject;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.privilegeType)) {
    query['PrivilegeType'] = request.privilegeType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tablePrivilegeObject)) {
    query['TablePrivilegeObject'] = request.tablePrivilegeObject;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAccountPrivileges',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取某一ADB账户的权限
 *
 * @param request DescribeAccountPrivilegesRequest
 * @return DescribeAccountPrivilegesResponse
 */
async function describeAccountPrivileges(request: DescribeAccountPrivilegesRequest): DescribeAccountPrivilegesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountPrivilegesWithOptions(request, runtime);
}

model DescribeAccountsRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

> If you do not specify this parameter, the information about all database accounts in the cluster is returned.', example='test_accout'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
  ownerId?: string(name='OwnerId'),
}

model DescribeAccountsResponseBody = {
  accountList?: {
    DBAccount?: [ 
    {
      accountDescription?: string(name='AccountDescription', description='The description of the database account.', example='test_accout_des'),
      accountName?: string(name='AccountName', description='The name of the database account.', example='test_accout'),
      accountStatus?: string(name='AccountStatus', description='The status of the database account. Valid values:

*   **Creating**
*   **Available**
*   **Deleting**', example='Available'),
      accountType?: string(name='AccountType', description='The type of the database account. Valid values:

*   **Normal**: standard account.
*   **Super**: privileged account.', example='Normal'),
      engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB**: the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
      ramUsers?: string(name='RamUsers', description='The ID of the Resource Access Management (RAM) user.', example='1958134230****'),
    }
  ](name='DBAccount')
  }(name='AccountList', description='The queried database accounts.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9CCFAAB4-97B7-5800-B9F2-685EB596E3EF'),
}

model DescribeAccountsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountsResponseBody(name='body'),
}

/**
 * @summary Queries the database accounts of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAccountsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountsResponse
 */
async function describeAccountsWithOptions(request: DescribeAccountsRequest, runtime: Util.RuntimeOptions): DescribeAccountsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAccounts',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the database accounts of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAccountsRequest
 * @return DescribeAccountsResponse
 */
async function describeAccounts(request: DescribeAccountsRequest): DescribeAccountsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountsWithOptions(request, runtime);
}

model DescribeAdbMySqlColumnsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp1r053byu48p****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  schema?: string(name='Schema', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model DescribeAdbMySqlColumnsResponseBody = {
  columnCount?: int32(name='ColumnCount', description='The total number of columns.', example='1'),
  columns?: [ 
    {
      comment?: string(name='Comment', description='The comments of the column.', example='test'),
      name?: string(name='Name', description='The name of the column.', example='id'),
      type?: string(name='Type', description='The data type of the column.', example='bigint'),
    }
  ](name='Columns', description='Details of the columns.'),
  message?: string(name='Message', description='The message returned for the operation. Valid values:

*   **Success** is returned if the operation is successful.
*   An error message is returned if the operation fails.', example='Success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A9F013CD-0222-595E-8157-445969B97F03'),
  schema?: string(name='Schema', description='The name of the database.', example='adb_demo'),
  success?: boolean(name='Success', description='Indicates whether the operation is successful. Valid values:

*   **true**: The operation is successful.
*   **false**: The operation fails.', example='true'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model DescribeAdbMySqlColumnsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdbMySqlColumnsResponseBody(name='body'),
}

/**
 * @summary Queries the information about table columns for an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAdbMySqlColumnsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdbMySqlColumnsResponse
 */
async function describeAdbMySqlColumnsWithOptions(request: DescribeAdbMySqlColumnsRequest, runtime: Util.RuntimeOptions): DescribeAdbMySqlColumnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schema)) {
    query['Schema'] = request.schema;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdbMySqlColumns',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about table columns for an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAdbMySqlColumnsRequest
 * @return DescribeAdbMySqlColumnsResponse
 */
async function describeAdbMySqlColumns(request: DescribeAdbMySqlColumnsRequest): DescribeAdbMySqlColumnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdbMySqlColumnsWithOptions(request, runtime);
}

model DescribeAdbMySqlSchemasRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1r053byu48p****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAdbMySqlSchemasResponseBody = {
  message?: string(name='Message', description='The returned message.

*   If the request was successful, a **success** message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  schemas?: [ string ](name='Schemas', description='The queried databases.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model DescribeAdbMySqlSchemasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdbMySqlSchemasResponseBody(name='body'),
}

/**
 * @summary Queries a list of databases for an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAdbMySqlSchemasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdbMySqlSchemasResponse
 */
async function describeAdbMySqlSchemasWithOptions(request: DescribeAdbMySqlSchemasRequest, runtime: Util.RuntimeOptions): DescribeAdbMySqlSchemasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdbMySqlSchemas',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of databases for an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAdbMySqlSchemasRequest
 * @return DescribeAdbMySqlSchemasResponse
 */
async function describeAdbMySqlSchemas(request: DescribeAdbMySqlSchemasRequest): DescribeAdbMySqlSchemasResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdbMySqlSchemasWithOptions(request, runtime);
}

model DescribeAdbMySqlTablesRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  schema?: string(name='Schema', description='The name of the database.', example='adb_demo', nullable=false),
}

model DescribeAdbMySqlTablesResponseBody = {
  message?: string(name='Message', description='The message returned for the operation. Valid values:

*   **Success** is returned if the operation is successful.
*   An error message is returned if the operation fails.', example='Success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7A7D49E3-5585-5DF8-B62C-75C46B4991DC'),
  schema?: string(name='Schema', description='The name of the database.', example='adb_demo'),
  success?: boolean(name='Success', description='Indicates whether the operation is successful. Valid values:

*   **true**: The operation is successful.
*   **false**: The operation fails.', example='true'),
  tables?: [ string ](name='Tables', description='The names of tables.'),
}

model DescribeAdbMySqlTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdbMySqlTablesResponseBody(name='body'),
}

/**
 * @summary Queries a list of tables for an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAdbMySqlTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdbMySqlTablesResponse
 */
async function describeAdbMySqlTablesWithOptions(request: DescribeAdbMySqlTablesRequest, runtime: Util.RuntimeOptions): DescribeAdbMySqlTablesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schema)) {
    query['Schema'] = request.schema;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdbMySqlTables',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of tables for an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAdbMySqlTablesRequest
 * @return DescribeAdbMySqlTablesResponse
 */
async function describeAdbMySqlTables(request: DescribeAdbMySqlTablesRequest): DescribeAdbMySqlTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdbMySqlTablesWithOptions(request, runtime);
}

model DescribeAdviceServiceEnabledRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-2ze0vp0j6t3to****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAdviceServiceEnabledResponseBody = {
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a **Success** message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='E031AABF-BD56-5966-A063-4283EF18DB45'),
  result?: boolean(name='Result', description='Indicates whether the suggestion feature is enabled. Valid values:

*   **True**
*   **False**', example='False'),
}

model DescribeAdviceServiceEnabledResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdviceServiceEnabledResponseBody(name='body'),
}

/**
 * @summary Queries whether the suggestion feature is enabled.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAdviceServiceEnabledRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdviceServiceEnabledResponse
 */
async function describeAdviceServiceEnabledWithOptions(request: DescribeAdviceServiceEnabledRequest, runtime: Util.RuntimeOptions): DescribeAdviceServiceEnabledResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdviceServiceEnabled',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether the suggestion feature is enabled.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAdviceServiceEnabledRequest
 * @return DescribeAdviceServiceEnabledResponse
 */
async function describeAdviceServiceEnabled(request: DescribeAdviceServiceEnabledRequest): DescribeAdviceServiceEnabledResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdviceServiceEnabledWithOptions(request, runtime);
}

model DescribeAllDataSourceRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1pke2pcfavw****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model DescribeAllDataSourceResponseBody = {
  columns?: {
    column?: [ 
    {
      autoIncrementColumn?: boolean(name='AutoIncrementColumn', description='Indicates whether the column is an auto-increment column. Valid values:

*   **true**
*   **false**', example='true'),
      columnName?: string(name='ColumnName', description='The name of the column.', example='id'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp1pke2pcfavw****'),
      primaryKey?: boolean(name='PrimaryKey', description='Indicates whether the column is the primary key of the table. Valid values:

*   **true**
*   **false**', example='false'),
      schemaName?: string(name='SchemaName', description='The logical name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The logical name of the table.', example='test'),
      type?: string(name='Type', description='The data type of the column.', example='bigint'),
    }
  ](name='Column')
  }(name='Columns', description='The queried columns.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7EDB8E4-9769-4233-88C7-DCA4C9******'),
  schemas?: {
    schema?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp1pke2pcfavw****'),
      schemaName?: string(name='SchemaName', description='The logical name of the database.', example='adb_demo'),
    }
  ](name='Schema')
  }(name='Schemas', description='The queried databases.'),
  tables?: {
    table?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp1pke2pcfavw****'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The logical name of the table.', example='test'),
    }
  ](name='Table')
  }(name='Tables', description='The queried tables.'),
}

model DescribeAllDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAllDataSourceResponseBody(name='body'),
}

/**
 * @summary Queries a list of databases, tables, and columns in an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAllDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAllDataSourceResponse
 */
async function describeAllDataSourceWithOptions(request: DescribeAllDataSourceRequest, runtime: Util.RuntimeOptions): DescribeAllDataSourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAllDataSource',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of databases, tables, and columns in an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeAllDataSourceRequest
 * @return DescribeAllDataSourceResponse
 */
async function describeAllDataSource(request: DescribeAllDataSourceRequest): DescribeAllDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAllDataSourceWithOptions(request, runtime);
}

model DescribeAppliedAdvicesRequest {
  adviceType?: string(name='AdviceType', description='The type of the suggestion. Valid values:

*   **INDEX**: index optimization.
*   **TIERING**: hot and cold data optimization.', example='INDEX'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  endTime?: long(name='EndTime', description='The end date of the time range to query. Specify the date in the yyyyMMdd format.', example='20220824'),
  keyword?: string(name='Keyword', description='The keyword that is used to query information by table name.', example='you_table_name'),
  lang?: string(name='Lang', description='The display language of the suggestion. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"SchemaName","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `SchemaName`: the name of the database.
    *   `TableName`: the name of the table.
    *   `JobStatus`: the status of the BUILD job that is triggered on the table.
    *   `SubmitTime`: the time when the suggestion was submitted.
    *   `Benefit`: the expected benefits of the applied optimization suggestion.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, optimization suggestions are sorted in descending order based on the submission time.', example='[{\\\\"Field\\\\":\\\\"AdviceType\\\\",\\\\"Type\\\\":\\\\"Desc\\\\"}]'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30**(Default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  schemaTableName?: string(name='SchemaTableName', description='The name of the table in the **DatabaseName.TableName** format.', example='tpch.lineitem'),
  startTime?: long(name='StartTime', description='The start date of the time range to query. Specify the date in the yyyyMMdd format.', example='20220811'),
}

model DescribeAppliedAdvicesResponseBody = {
  items?: [ 
    {
      adviceId?: string(name='AdviceId', description='The suggestion ID.', example='7417db9c-914d-43f3-a123-4d0e448f****'),
      benefit?: string(name='Benefit', description='The benefit of the suggestion.', example='0.4 GB of storage saved'),
      buildSQL?: string(name='BuildSQL', description='The SQL statement that is used to execute the BUILD job.', example='build table `schema1`.`table1`'),
      jobStatus?: string(name='JobStatus', description='The status of the suggestion execution job. Valid values:

*   **SUCCEED**
*   **FAILED**', example='SUCCEED'),
      pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
      pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30**(Default)
*   **50**
*   **100**', example='30'),
      rollbackSQL?: string(name='RollbackSQL', description='The SQL statement that is used to roll back the suggestion.', example='alter table `schema1`.`table1` add key col1_1_idx(col1)'),
      SQL?: string(name='SQL', description='The SQL statement that is used to apply the suggestion.', example='alter table `schema1`.`table1` drop key col1_1_idx'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      submitStatus?: string(name='SubmitStatus', description='The submission status of the suggestion. Valid values:

*   **SUCCEED**
*   **FAILED**', example='SUCCEED'),
      submitTime?: string(name='SubmitTime', description='The time when the suggestion was submitted. The time follows the ISO 8601 standard in the yyMMddHHmm format. The time is displayed in UTC.', example='2208131600'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
      totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
    }
  ](name='Items', description='The queried applied optimization suggestions.'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30**(Default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='84489769-3065-5A28-A4CB-977CD426F1C3'),
  schemaTableNames?: [ string ](name='SchemaTableNames', description='The name of the table in the DatabaseName.TableName format.'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeAppliedAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAppliedAdvicesResponseBody(name='body'),
}

/**
 * @summary Queries the applied optimization suggestions for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAppliedAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAppliedAdvicesResponse
 */
async function describeAppliedAdvicesWithOptions(request: DescribeAppliedAdvicesRequest, runtime: Util.RuntimeOptions): DescribeAppliedAdvicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceType)) {
    query['AdviceType'] = request.adviceType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaTableName)) {
    query['SchemaTableName'] = request.schemaTableName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppliedAdvices',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the applied optimization suggestions for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAppliedAdvicesRequest
 * @return DescribeAppliedAdvicesResponse
 */
async function describeAppliedAdvices(request: DescribeAppliedAdvicesRequest): DescribeAppliedAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppliedAdvicesWithOptions(request, runtime);
}

model DescribeApsActionLogsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp1r053byu48p****'),
  endTime?: string(name='EndTime', description='The end time of the logs to be queried. Specify the time in the ISO 8601 standard in the **yyyy-MM-ddTHH:mmZ** format. The time must be in UTC.

>  The end time must be later than the start time. The maximum time range that can be specified is 30 days.

This parameter is required.', example='2023-02-11T09:30:00Z'),
  keyword?: string(name='Keyword', description='The keyword that you want to use for fuzzy match in the query.', example='table_test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  stage?: string(name='Stage', description='The phase during which the logs to be queried were generated. Valid values:

*   **StructureMigrate**: schema migration.
*   **FullDataSync**: full data synchronization.
*   **IncrementalSync**: incremental data synchronization.

>  If you do not specify this parameter, logs of all the phases are queried.', example='FullDataSync'),
  startTime?: string(name='StartTime', description='The start time of the logs to be queried. Specify the time in the ISO 8601 standard in the **yyyy-MM-ddTHH:mmZ** format. The time must be in UTC.

This parameter is required.', example='2023-02-11T08:30:00Z'),
  state?: string(name='State', description='The types of the logs. Separate multiple log types with commas (,). Valid values:

*   **INFO**
*   **WARN**
*   **ERROR**

>  If you do not specify this parameter, logs of all types are queried.', example='INFO,WARN,ERROR'),
  workloadId?: string(name='WorkloadId', description='The ID of the real-time data ingestion job.

This parameter is required.', example='aps-hz109vpvt4fg8528d****'),
}

model DescribeApsActionLogsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial.', example='{
  "AuthAction": "xxx",
  "AuthPrincipalDisplayName": "sampleName",
  "AuthPrincipalOwnerId": "111111111111111111",
  "AuthPrincipalType": "SubUser",
  "AuthResource": "xxx",
  "NoPermissionType": "xxx",
  "PolicyType": "xxx"
}'),
  actionLogs?: [ 
    {
      context?: string(name='Context', description='The content of the log.', example='DDL migration job finished'),
      stage?: string(name='Stage', description='The phase during which the log was generated. Valid values:

*   **StructureMigrate**: schema migration.
*   **FullDataSync**: full data synchronization.
*   **IncrementalSync**: incremental data synchronization.', example='FullDataSync'),
      state?: string(name='State', description='The type of the log. Multiple log types are separated by commas (,). Valid values:

*   **INFO**
*   **WARN**
*   **ERROR**', example='INFO,WARN,ERROR'),
      time?: string(name='Time', description='The time when the log was generated. The time follows the ISO 8601 standard in the **yyyy-MM-ddTHH:mm:ssZ** format. The time is displayed in UTC.', example='2023-02-01T05:46:30Z'),
    }
  ](name='ActionLogs', description='The queried logs.'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.', example='amv-bp1r053byu48p****'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='A5EDBA27-AF3E-5966-9503-FD1557E19167'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='3'),
  workloadId?: string(name='WorkloadId', description='The ID of the real-time data ingestion job.', example='aps-hz109vpvt4fg8528d****'),
}

model DescribeApsActionLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsActionLogsResponseBody(name='body'),
}

/**
 * @summary Queries the logs of a real-time data ingestion job for an AnalyticDB for MySQL cluster.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeApsActionLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsActionLogsResponse
 */
async function describeApsActionLogsWithOptions(request: DescribeApsActionLogsRequest, runtime: Util.RuntimeOptions): DescribeApsActionLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.stage)) {
    query['Stage'] = request.stage;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  if (!Util.isUnset(request.workloadId)) {
    query['WorkloadId'] = request.workloadId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsActionLogs',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the logs of a real-time data ingestion job for an AnalyticDB for MySQL cluster.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeApsActionLogsRequest
 * @return DescribeApsActionLogsResponse
 */
async function describeApsActionLogs(request: DescribeApsActionLogsRequest): DescribeApsActionLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsActionLogsWithOptions(request, runtime);
}

model DescribeApsDatasourceRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

This parameter is required.', example='am-*******'),
  datasourceId?: long(name='DatasourceId', description='The data source ID.

This parameter is required.', example='1'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-beijing'),
}

model DescribeApsDatasourceResponseBody = {
  apsDatasource?: {
    createTime?: string(name='CreateTime', description='The time when the data source was created.', example='2024-04-12T15:03:38Z'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-******'),
    databricksInfo?: {
      accessToken?: string(name='accessToken', description='The token that is used to access Databricks.', example='******'),
      workspaceURL?: string(name='workspaceURL', description='The URL of the workspace.', example='-'),
    }(name='DatabricksInfo', description='The information about Databricks.', example='-'),
    datasourceDescription?: string(name='DatasourceDescription', description='The description of the data source.', example='test'),
    datasourceName?: string(name='DatasourceName', description='The name of the data source.', example='kafka-2024***'),
    datasourceType?: string(name='DatasourceType', description='The type of the data source.', example='KAFKA'),
    hiveInfo?: {
      emrClusterId?: string(name='EmrClusterId', description='The ID of the E-MapReduce (EMR) cluster.', example='-'),
      metaStoreUri?: string(name='MetaStoreUri', description='The URL of the Hive Metastore.', example='-'),
      securityGroup?: string(name='SecurityGroup', description='The security group ID.', example='sg-******'),
      vswitch?: string(name='Vswitch', description='The vSwitch ID.', example='vsw-******'),
    }(name='HiveInfo', description='The information about the Hive data source.', example='-'),
    kafkaInfo?: {
      kafkaClusterId?: string(name='KafkaClusterId', description='The ID of the Kafka instance.', example='-'),
      kafkaTopic?: string(name='KafkaTopic', description='The topic of the Kafka instance.', example='[{\\\\"value\\\\": \\\\"hongxian_test\\\\"}]'),
    }(name='KafkaInfo', description='The information about the Kafka instance.', example='-'),
    polarDBMysqlInfo?: {
      across?: boolean(name='Across', description='The parameter is no longer supported.', example='-'),
      acrossRole?: string(name='AcrossRole', description='The parameter is no longer supported.', example='-'),
      acrossUid?: string(name='AcrossUid', description='The parameter is no longer supported.', example='-'),
      connectUrl?: string(name='ConnectUrl', description='The parameter is no longer supported.', example='-'),
      instanceId?: string(name='InstanceId', description='The parameter is no longer supported.', example='-'),
      regionId?: string(name='RegionId', description='The parameter is no longer supported.', example='-'),
      securityGroup?: string(name='SecurityGroup', description='The parameter is no longer supported.', example='-'),
      userName?: string(name='UserName', description='The parameter is no longer supported.', example='-'),
    }(name='PolarDBMysqlInfo', description='The parameter is no longer supported.', example='-'),
    rdsMysqlInfo?: {
      connectUrl?: string(name='ConnectUrl', description='The parameter is no longer supported.', example='-'),
      instanceId?: string(name='InstanceId', description='The parameter is no longer supported.', example='-'),
      regionId?: string(name='RegionId', description='The parameter is no longer supported.', example='-'),
      securityGroup?: string(name='SecurityGroup', description='The parameter is no longer supported.', example='-'),
      userName?: string(name='UserName', description='The parameter is no longer supported.', example='-'),
    }(name='RdsMysqlInfo', description='The parameter is no longer supported.', example='-'),
    slsInfo?: {
      across?: boolean(name='Across', description='Indicates whether the data source is a cross-account resource. Valid values:

*   **true**
*   **false**', example='false'),
      acrossRole?: string(name='AcrossRole', description='The name of the cross-account role.', example='test'),
      acrossUid?: string(name='AcrossUid', description='The cross-account UID.', example='123456'),
      project?: string(name='Project', description='The name of the SLS project.', example='***'),
      sourceRegionId?: string(name='SourceRegionId', description='The region ID.', example='cn-hangzhou'),
      store?: string(name='Store', description='The name of the SLS Logstore.', example='***'),
    }(name='SlsInfo', description='The Simple Log Service (SLS) project.', example='-'),
  }(name='ApsDatasource', description='The queried APS data source.'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-**D8-5***-A***-****587'),
}

model DescribeApsDatasourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsDatasourceResponseBody(name='body'),
}

/**
 * @summary Queries the information about an AnalyticDB Pipeline Service (APS) data source.
 *
 * @param request DescribeApsDatasourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsDatasourceResponse
 */
async function describeApsDatasourceWithOptions(request: DescribeApsDatasourceRequest, runtime: Util.RuntimeOptions): DescribeApsDatasourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsDatasource',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an AnalyticDB Pipeline Service (APS) data source.
 *
 * @param request DescribeApsDatasourceRequest
 * @return DescribeApsDatasourceResponse
 */
async function describeApsDatasource(request: DescribeApsDatasourceRequest): DescribeApsDatasourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsDatasourceWithOptions(request, runtime);
}

model DescribeApsDatasourcesRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.', example='amv-******'),
  datasourceName?: string(name='DatasourceName', description='The name of the data source.', example='test'),
  datasourceType?: string(name='DatasourceType', description='The type of the data source.', example='SLS'),
  endTime?: string(name='EndTime', description='The end of the time range to query.', example='2024-01-30'),
  pageNumber?: int32(name='PageNumber', description='The page number.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

This parameter is required.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.', example='2024-01-01'),
}

model DescribeApsDatasourcesResponseBody = {
  apsDatasources?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the data source was created.', example='2024-01-10 14:44:33'),
      datasourceDescription?: string(name='DatasourceDescription', description='The description of the data source.', example='test'),
      datasourceId?: long(name='DatasourceId', description='The data source ID.', example='1'),
      datasourceName?: string(name='DatasourceName', description='The name of the data source.', example='test'),
      datasourceType?: string(name='DatasourceType', description='The type of the data source.', example='SLS'),
      hasJob?: boolean(name='HasJob', description='Indicates whether a job is using the data source.', example='false'),
    }
  ](name='ApsDatasources', description='The queried APS data sources.', example='-'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-5213-******-B608-******'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeApsDatasourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsDatasourcesResponseBody(name='body'),
}

/**
 * @summary Queries a list of AnalyticDB Pipeline Service (APS) data sources.
 *
 * @param request DescribeApsDatasourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsDatasourcesResponse
 */
async function describeApsDatasourcesWithOptions(request: DescribeApsDatasourcesRequest, runtime: Util.RuntimeOptions): DescribeApsDatasourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.datasourceName)) {
    body['DatasourceName'] = request.datasourceName;
  }
  if (!Util.isUnset(request.datasourceType)) {
    body['DatasourceType'] = request.datasourceType;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsDatasources',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of AnalyticDB Pipeline Service (APS) data sources.
 *
 * @param request DescribeApsDatasourcesRequest
 * @return DescribeApsDatasourcesResponse
 */
async function describeApsDatasources(request: DescribeApsDatasourcesRequest): DescribeApsDatasourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsDatasourcesWithOptions(request, runtime);
}

model DescribeApsHiveWorkloadRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  workloadId?: string(name='WorkloadId', description='The job ID.

This parameter is required.', example='aps-******'),
}

model DescribeApsHiveWorkloadResponseBody = {
  apsWorkload?: {
    advancedConfig?: string(name='AdvancedConfig', description='The advanced configurations.', example='test.adv.config=value'),
    conflictStrategy?: string(name='ConflictStrategy', description='The policy to handle tables with the same name in the destination cluster.', example='Intercept'),
    createTime?: string(name='CreateTime', description='The time when the workload was created.', example='-'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-*******'),
    datasourceId?: long(name='DatasourceId', description='The data source ID.', example='8'),
    datasourceName?: string(name='DatasourceName', description='The name of the data source.', example='sls-******'),
    emrClusterId?: string(name='EmrClusterId', description='The ID of the E-MapReduce (EMR) cluster.', example='-'),
    fullComputeUnit?: string(name='FullComputeUnit', description='The number of AnalyticDB compute units (ACUs) required for migration.', example='16'),
    metaStoreUri?: string(name='MetaStoreUri', description='The URL of the Hive Metastore.', example='-'),
    ossLocation?: string(name='OssLocation', description='The Object Storage Service (OSS) URL of the AnalyticDB for MySQL cluster data.', example='oss://******'),
    parallelism?: long(name='Parallelism', description='The number of tasks that are allowed in parallel.', example='2'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    resourceGroup?: string(name='ResourceGroup', description='The resource group to which the SQL statement belongs.', example='test'),
    state?: string(name='State', description='The status of the workload.', example='COMPLETED'),
    syncAllowExpression?: string(name='SyncAllowExpression', description='The expression that manually matches the source database table whitelist.', example='abc'),
    syncDenyExpression?: string(name='SyncDenyExpression', description='Manually match the blacklist expressions for source database tables.', example='def'),
    targetType?: string(name='TargetType', description='The destination type.', example='OSS'),
    vswitch?: string(name='Vswitch', description='The name of the vSwitch.', example='vsw-******'),
    workloadId?: string(name='WorkloadId', description='The job ID.', example='aps-******'),
    workloadName?: string(name='WorkloadName', description='The name of the workload.', example='test'),
    workloadTypeName?: string(name='WorkloadTypeName', description='The name of the workload.', example='test'),
  }(name='ApsWorkload', description='The queried job.', example='-'),
  requestId?: string(name='RequestId', description='The request ID.', example='86F92D26-B774-5FA1-8E53-******'),
}

model DescribeApsHiveWorkloadResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsHiveWorkloadResponseBody(name='body'),
}

/**
 * @summary Queries the information about an AnalyticDB Pipeline Service (APS) job from a Hive data source.
 *
 * @param request DescribeApsHiveWorkloadRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsHiveWorkloadResponse
 */
async function describeApsHiveWorkloadWithOptions(request: DescribeApsHiveWorkloadRequest, runtime: Util.RuntimeOptions): DescribeApsHiveWorkloadResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.workloadId)) {
    body['WorkloadId'] = request.workloadId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsHiveWorkload',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an AnalyticDB Pipeline Service (APS) job from a Hive data source.
 *
 * @param request DescribeApsHiveWorkloadRequest
 * @return DescribeApsHiveWorkloadResponse
 */
async function describeApsHiveWorkload(request: DescribeApsHiveWorkloadRequest): DescribeApsHiveWorkloadResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsHiveWorkloadWithOptions(request, runtime);
}

model DescribeApsJobDetailRequest {
  apsJobId?: string(name='ApsJobId', description='The job ID.

This parameter is required.', example='aps-******'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
}

model DescribeApsJobDetailResponseBody = {
  APSJobDetail?: {
    dbList?: string(name='DbList', description='The objects that are synchronized.', example='{}'),
    destinationEndpointInstanceID?: string(name='DestinationEndpointInstanceID', description='The ID of the destination cluster.', example='amv-******'),
    destinationEndpointRegion?: string(name='DestinationEndpointRegion', description='The region of the destination cluster.', example='cn-beijing'),
    partitionList?: string(name='PartitionList', description='The partitions.', example='{}'),
    sourceEndpointInstanceID?: string(name='SourceEndpointInstanceID', description='The ID of the source instance.', example='pc-*******'),
    sourceEndpointRegion?: string(name='SourceEndpointRegion', description='The region of the source instance.', example='cn-beijing'),
    status?: string(name='Status', description='The status of the job.', example='Running'),
    targetTableMode?: string(name='TargetTableMode', description='The mode of the destination table.', example='0'),
  }(name='APSJobDetail', description='The queried job.', example='-'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-E606-4A42-BF6D-******'),
}

model DescribeApsJobDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsJobDetailResponseBody(name='body'),
}

/**
 * @summary Queries the information about an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request DescribeApsJobDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsJobDetailResponse
 */
async function describeApsJobDetailWithOptions(request: DescribeApsJobDetailRequest, runtime: Util.RuntimeOptions): DescribeApsJobDetailResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apsJobId)) {
    body['ApsJobId'] = request.apsJobId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsJobDetail',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request DescribeApsJobDetailRequest
 * @return DescribeApsJobDetailResponse
 */
async function describeApsJobDetail(request: DescribeApsJobDetailRequest): DescribeApsJobDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsJobDetailWithOptions(request, runtime);
}

model DescribeApsJobsRequest {
  apsJobName?: string(name='ApsJobName', description='The name of the APS job.', example='aps-xxxxx'),
  createTimeEnd?: string(name='CreateTimeEnd', description='The end of the time range to query.', example='2022-04-23T01:10Z'),
  createTimeStart?: string(name='CreateTimeStart', description='The beginning of the time range to query.', example='2022-03-23T01:10Z'),
  pageNumber?: int32(name='PageNumber', description='The page number.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

This parameter is required.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
}

model DescribeApsJobsResponseBody = {
  APSJobs?: [ 
    {
      apsJobId?: string(name='ApsJobId', description='The job ID.', example='aps-******'),
      apsJobName?: string(name='ApsJobName', description='The name of the APS job.', example='data-sync-******'),
      createTime?: string(name='CreateTime', description='The time when the APS job was created.', example='2022-06-28 15:00:04'),
      delay?: long(name='Delay', description='The synchronization latency.', example='0'),
      destinationInstanceID?: string(name='DestinationInstanceID', description='The destination cluster ID.', example='amv-*******'),
      errMessage?: string(name='ErrMessage', description='The error message.', example='OK'),
      projress?: string(name='Projress', description='The progress.', example='30: The progress is 30%.'),
      sourceInstanceID?: string(name='SourceInstanceID', description='The ID of the source instance or cluster.', example='pc-******'),
      status?: string(name='Status', description='The status of the APS job.', example='-'),
      subStatus?: string(name='SubStatus', description='The status of the task.', example='-'),
    }
  ](name='APSJobs', description='The queried APS jobs.', example='-'),
  code?: string(name='Code', description='The HTTP status code.', example='ok'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The status code. A value of 200 indicates that the request was successful.', example='ok'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-7F9D-5DBD-993E-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='0'),
}

model DescribeApsJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsJobsResponseBody(name='body'),
}

/**
 * @summary Queries a list of AnalyticDB Pipeline Service (APS) jobs.
 *
 * @param request DescribeApsJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsJobsResponse
 */
async function describeApsJobsWithOptions(request: DescribeApsJobsRequest, runtime: Util.RuntimeOptions): DescribeApsJobsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apsJobName)) {
    body['ApsJobName'] = request.apsJobName;
  }
  if (!Util.isUnset(request.createTimeEnd)) {
    body['CreateTimeEnd'] = request.createTimeEnd;
  }
  if (!Util.isUnset(request.createTimeStart)) {
    body['CreateTimeStart'] = request.createTimeStart;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsJobs',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of AnalyticDB Pipeline Service (APS) jobs.
 *
 * @param request DescribeApsJobsRequest
 * @return DescribeApsJobsResponse
 */
async function describeApsJobs(request: DescribeApsJobsRequest): DescribeApsJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsJobsWithOptions(request, runtime);
}

model DescribeApsMigrationWorkloadsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-*******'),
  endTime?: string(name='EndTime', description='The end of the time range to query.', example='2021-07-20T16:00:00Z'),
  ossLocation?: string(name='OssLocation', description='The Object Storage Service (OSS) URL.', example='oss://******'),
  pageNumber?: int32(name='PageNumber', description='The page number.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

This parameter is required.', example='30'),
  startTime?: string(name='StartTime', description='The start of the time range to query.', example='2021-06-20T16:00:00Z'),
  workloadName?: string(name='WorkloadName', description='The name of the workload.', example='test'),
}

model DescribeApsMigrationWorkloadsResponseBody = {
  migrationWorkloads?: [ 
    {
      acuCount?: int32(name='AcuCount', description='The number of AnalyticDB compute units (ACUs).', example='-'),
      createTime?: string(name='CreateTime', description='The time when the job was created.', example='2021-06-21T02:15:16Z'),
      failedMsg?: string(name='FailedMsg', description='The error message.', example='-'),
      id?: string(name='Id', description='The job ID.', example='123'),
      maxRT?: string(name='MaxRT', description='The maximum response time.', example='1000'),
      modifyTime?: string(name='ModifyTime', description='The time when the migration job was modified.', example='2021-06-21T02:15:16Z'),
      name?: string(name='Name', description='The name of the workload.', example='TEST-001'),
      ossLocation?: string(name='OssLocation', description='The OSS URL.', example='oss://******'),
      state?: string(name='State', description='The status.', example='COMPLETED'),
      targetType?: string(name='TargetType', description='The destination type.', example='OSS'),
      workloadSubType?: string(name='WorkloadSubType', description='The sub-type of the workload.', example='test'),
    }
  ](name='MigrationWorkloads', description='The queried migration workloads.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-57F0-9F06-******'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='0'),
}

model DescribeApsMigrationWorkloadsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsMigrationWorkloadsResponseBody(name='body'),
}

/**
 * @summary Queries the workloads of AnalyticDB Pipeline Service (APS) migration jobs.
 *
 * @param request DescribeApsMigrationWorkloadsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsMigrationWorkloadsResponse
 */
async function describeApsMigrationWorkloadsWithOptions(request: DescribeApsMigrationWorkloadsRequest, runtime: Util.RuntimeOptions): DescribeApsMigrationWorkloadsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ossLocation)) {
    body['OssLocation'] = request.ossLocation;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.workloadName)) {
    body['WorkloadName'] = request.workloadName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsMigrationWorkloads',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the workloads of AnalyticDB Pipeline Service (APS) migration jobs.
 *
 * @param request DescribeApsMigrationWorkloadsRequest
 * @return DescribeApsMigrationWorkloadsResponse
 */
async function describeApsMigrationWorkloads(request: DescribeApsMigrationWorkloadsRequest): DescribeApsMigrationWorkloadsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsMigrationWorkloadsWithOptions(request, runtime);
}

model DescribeApsProgressRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-******'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  workloadId?: string(name='WorkloadId', description='The job ID.

This parameter is required.', example='aps-******'),
}

model DescribeApsProgressResponseBody = {
  apsHiveProgress?: [ 
    {
      dbName?: string(name='DbName', description='The name of the database.', example='test'),
      progress?: string(name='Progress', description='The migration progress.', example='95'),
      speed?: string(name='Speed', description='The migration speed.', example='2'),
      tbName?: string(name='TbName', description='The name of the table.', example='test'),
    }
  ](name='ApsHiveProgress', description='The migration progress.', example='-'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  successPercentage?: int32(name='SuccessPercentage', description='The success rate.', example='100'),
  successTableCount?: int32(name='SuccessTableCount', description='The total number of migrated tables returned.', example='10'),
  totalTableCount?: int32(name='TotalTableCount', description='The total number of tables to be migrated.', example='10'),
}

model DescribeApsProgressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsProgressResponseBody(name='body'),
}

/**
 * @summary Queries the progress of an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request DescribeApsProgressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsProgressResponse
 */
async function describeApsProgressWithOptions(request: DescribeApsProgressRequest, runtime: Util.RuntimeOptions): DescribeApsProgressResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.workloadId)) {
    body['WorkloadId'] = request.workloadId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsProgress',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the progress of an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request DescribeApsProgressRequest
 * @return DescribeApsProgressResponse
 */
async function describeApsProgress(request: DescribeApsProgressRequest): DescribeApsProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsProgressWithOptions(request, runtime);
}

model DescribeApsResourceGroupsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-bp1t6rym21****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.', example='cn-hangzhou'),
  workloadId?: string(name='WorkloadId', description='The ID of the data synchronization job.', example='aps-hz1686v37sx****'),
}

model DescribeApsResourceGroupsResponseBody = {
  data?: {
    resourceGroups?: [ 
      {
        available?: boolean(name='Available', description='Indicates whether the resource group is available. Valid values:

*   **true**
*   **false**', example='True'),
        cuOptions?: [ long ](name='CuOptions'),
        groupName?: string(name='GroupName', description='The name of the resource group.', example='test'),
        groupType?: string(name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

>  For more information about resource groups, see [Resource groups](https://help.aliyun.com/document_detail/428610.html).', example='Job'),
        leftComputeResource?: int32(name='LeftComputeResource', description='The amount of remaining computing resources. Unit: ACUs.', example='512'),
        maxComputeResource?: int32(name='MaxComputeResource', description='The maximum amount of reserved computing resources. Unit: ACUs.

*   If the value of GroupType is **Interactive**, the amount of reserved computing resources that are not allocated in the cluster is returned in increments of 16 ACUs.
*   If the value of GroupType is **Job**, the amount of reserved computing resources that are not allocated in the cluster is returned in increments of 8 ACUs.', example='512'),
        minComputeResource?: int32(name='MinComputeResource', description='The minimum amount of reserved computing resources. Unit: ACUs.

*   If the value of GroupType is **Interactive**, 16 is returned.
*   If the value of GroupType is **Job**, 0 is returned.', example='0'),
      }
    ](name='ResourceGroups', description='The queried resource groups.'),
    step?: long(name='Step', description='The step size of resources. Unit: AnalyticDB compute units (ACUs).

*   If the value of GroupType is **Interactive**, 16 is returned.
*   If the value of GroupType is **Job**, 8 is returned.', example='8'),
  }(name='Data', description='The queried resource groups.'),
  httpStatusCode?: long(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message.

*   If the request was successful, a success message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FC370D7-1D4C-5A8E-805E-F73366382C66'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
}

model DescribeApsResourceGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApsResourceGroupsResponseBody(name='body'),
}

/**
 * @summary Queries the information about resource groups of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeApsResourceGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApsResourceGroupsResponse
 */
async function describeApsResourceGroupsWithOptions(request: DescribeApsResourceGroupsRequest, runtime: Util.RuntimeOptions): DescribeApsResourceGroupsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.workloadId)) {
    body['WorkloadId'] = request.workloadId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApsResourceGroups',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about resource groups of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeApsResourceGroupsRequest
 * @return DescribeApsResourceGroupsResponse
 */
async function describeApsResourceGroups(request: DescribeApsResourceGroupsRequest): DescribeApsResourceGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApsResourceGroupsWithOptions(request, runtime);
}

model DescribeAuditLogRecordsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-t4nj8619bz2w3****'),
  DBName?: string(name='DBName', description='The name of the database on which the SQL statement was executed.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.', example='2022-08-12T17:08Z'),
  hostAddress?: string(name='HostAddress', description='The IP address and port number of the client that is used to execute the SQL statement.', example='100.104.XX.XX:43908'),
  order?: string(name='Order', description='The order in which to sort the retrieved entries by field. Specify this parameter in the JSON format. The value is an ordered array that uses the order of the input array and contains `Field` and `Type`. Example: `[{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}]`. Fields:

*   `Field`: the field that is used to sort the retrieved entries. Valid values:

    *   **HostAddress**: the IP address of the client that is used to connect to the database.
    *   **UserName**: the username.
    *   **ExecutionStartTime**: the start time of the query execution.
    *   **QueryTime**: the amount of time consumed to execute the SQL statement.
    *   **PeakMemoryUsage**: the maximum memory usage when the SQL statement is executed.
    *   **ScanRows**: the number of rows to be scanned from a data source in the task.
    *   **ScanSize**: the amount of data to be scanned.
    *   **ScanTime**: the total amount of time consumed to scan data.
    *   **PlanningTime**: the amount of time consumed to generate execution plans.
    *   **WallTime**: the accumulated CPU Time values of all operators in the query on each node.
    *   **ProcessID**: the process ID.

*   `Type`: the sorting type of the retrieved entries. Valid values:

    *   **Desc**: descending order.
    *   **Asc**: ascending order.', example='[{"Field":"ExecuteTime","Type":"Desc"},{"Field":"HostAddress","Type":"Asc"}]'),
  orderType?: string(name='OrderType', description='The sorting order of the retrieved entries. Valid values:

*   **asc**: sorts the retrieved entries by time in ascending order.
*   **desc**: sorts the retrieved entries by time in descending order.', example='asc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **10** (default)
*   **30**
*   **50**
*   **100**', example='10'),
  proxyUser?: string(name='ProxyUser', description='A reserved parameter.', example='none'),
  queryKeyword?: string(name='QueryKeyword', description='The keyword based on which audit logs are queried. You can set this parameter to a value of the STRING type.', example='adb'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sqlType?: string(name='SqlType', description='The type of the SQL statement. Valid values:

*   **DELETE**
*   **SELECT**
*   **UPDATE**
*   **INSERT INTO SELECT**
*   **ALTER**
*   **DROP**
*   **CREATE**

>  You can query only a single type of SQL statements at a time. If you leave this parameter empty, all types of SQL statements are queried.', example='SELECT'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

> SQL audit logs can be queried only when SQL audit is enabled. Only SQL audit logs within the last 30 days can be queried. If SQL audit was disabled and re-enabled, only SQL audit logs from the time when SQL audit was re-enabled can be queried.', example='2022-08-12T04:17Z'),
  succeed?: string(name='Succeed', description='Specifies whether the execution of the SQL statement succeeds. Valid values:

*   **true**
*   **false**', example='true'),
  user?: string(name='User', description='The username that is used to execute the SQL statement.', example='test'),
}

model DescribeAuditLogRecordsResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.', example='amv-t4nj8619bz2w3****'),
  items?: [ 
    {
      connId?: string(name='ConnId', description='The connection ID.', example='14356****'),
      DBName?: string(name='DBName', description='The name of the database on which the SQL statement was executed.', example='adb_demo'),
      executeTime?: string(name='ExecuteTime', description='The start time of the execution of the SQL statement. The time is displayed in the ISO 8601 standard in the yyyy-MM-dd HH:mm:ss format. The time must be in UTC.', example='2022-08-12 10:10:00'),
      hostAddress?: string(name='HostAddress', description='The IP address and port number of the client that is used to execute the SQL statement.', example='100.104.XX.XX:43908'),
      processID?: string(name='ProcessID', description='The task ID.', example='202106081752021720161662490345362390'),
      SQLText?: string(name='SQLText', description='The SQL statement.', example='SELECT * FROM adb_hdfs_import_source'),
      SQLType?: string(name='SQLType', description='The type of the SQL statement.', example='SELECT'),
      succeed?: string(name='Succeed', description='Indicates whether the SQL statement was successfully executed. Valid values:

*   **true**
*   **false**', example='true'),
      totalTime?: string(name='TotalTime', description='The amount of time that is consumed to execute the SQL statement. Unit: milliseconds.', example='216'),
      user?: string(name='User', description='The username that is used to execute the SQL statement.', example='test'),
    }
  ](name='Items', description='The queried SQL audit logs.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='8A564B7F-8C00-43C0-8EC5-919FBB70573'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='6974'),
}

model DescribeAuditLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditLogRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the SQL audit logs of an AnalyticDB for MySQL cluster.
 *
 * @description *   SQL audit logs can be queried only when SQL audit is enabled. Only SQL audit logs within the last 30 days can be queried. If SQL audit was disabled and re-enabled, only SQL audit logs from the time when SQL audit was re-enabled can be queried. The following operations are not recorded in SQL audit logs: **INSERT INTO VALUES**, **REPLACE INTO VALUES**, and **UPSERT INTO VALUES**.
 * *   For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAuditLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditLogRecordsResponse
 */
async function describeAuditLogRecordsWithOptions(request: DescribeAuditLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeAuditLogRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.hostAddress)) {
    query['HostAddress'] = request.hostAddress;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.proxyUser)) {
    query['ProxyUser'] = request.proxyUser;
  }
  if (!Util.isUnset(request.queryKeyword)) {
    query['QueryKeyword'] = request.queryKeyword;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sqlType)) {
    query['SqlType'] = request.sqlType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.succeed)) {
    query['Succeed'] = request.succeed;
  }
  if (!Util.isUnset(request.user)) {
    query['User'] = request.user;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAuditLogRecords',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the SQL audit logs of an AnalyticDB for MySQL cluster.
 *
 * @description *   SQL audit logs can be queried only when SQL audit is enabled. Only SQL audit logs within the last 30 days can be queried. If SQL audit was disabled and re-enabled, only SQL audit logs from the time when SQL audit was re-enabled can be queried. The following operations are not recorded in SQL audit logs: **INSERT INTO VALUES**, **REPLACE INTO VALUES**, and **UPSERT INTO VALUES**.
 * *   For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeAuditLogRecordsRequest
 * @return DescribeAuditLogRecordsResponse
 */
async function describeAuditLogRecords(request: DescribeAuditLogRecordsRequest): DescribeAuditLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAuditLogRecordsWithOptions(request, runtime);
}

model DescribeAvailableAdvicesRequest {
  adviceDate?: long(name='AdviceDate', description='The date when the suggestion is generated. Specify the date in the yyyyMMdd format.

>  Suggestions are generated after analysis after midnight every day. You must specify a date that is at least one day earlier than the current date. For example, if the current date is 20240627, you must specify 20240626 or an earlier date.', example='20221124'),
  adviceType?: string(name='AdviceType', description='The type of the suggestion. Valid values:

*   **INDEX**: index optimization.
*   **TIERING**: hot and cold data optimization.', example='INDEX'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp198m028ih55****'),
  keyword?: string(name='Keyword', description='The keyword that is used to query information by table name.', example='you_table_name'),
  lang?: string(name='Lang', description='The display language of suggestions. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"SchemaName","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `SchemaName`: the name of the database.
    *   `TableName`: the name of the table.
    *   `Benefit`: the expected benefits of the applied optimization suggestion.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, the query results are sorted in descending order based on the Benefit field.', example='[{\\\\"Field\\\\":\\\\"AdviceType\\\\",\\\\"Type\\\\":\\\\"Desc\\\\"}]'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  schemaTableName?: string(name='SchemaTableName', description='The name of the table in the DatabaseName.TableName format.', example='tpch.lineitem'),
}

model DescribeAvailableAdvicesResponseBody = {
  items?: [ 
    {
      adviceDate?: string(name='AdviceDate', description='The date when the suggestion is generated. The date is in the yyyyMMdd format.', example='20221124'),
      adviceId?: string(name='AdviceId', description='The suggestion ID.', example='dcd04135-0925-4aed-a5a7-e7d92cb1****'),
      adviceType?: string(name='AdviceType', description='The type of the suggestion. Valid values:

*   **INDEX**: index optimization.
*   **TIERING**: hot and cold data optimization.', example='INDEX'),
      benefit?: string(name='Benefit', description='The benefit of the suggestion.', example='0.4 GB of storage saved'),
      pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
      pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
      reason?: string(name='Reason', description='The reason why the suggestion was generated.', example='Unused for 15 days, historical usage less than 1%'),
      SQL?: string(name='SQL', description='The SQL statement that is used to apply the suggestion.', example='alter table `schema1`.`table1` drop key col1_1_idx'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test_table'),
      totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='10192'),
    }
  ](name='Items', description='The queried suggestions.'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='96A55627-28E9-5E47-B8F6-D786BE551349'),
  schemaTableNames?: [ string ](name='SchemaTableNames', description='The name of the table in the DatabaseName.TableName format.'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='10192'),
}

model DescribeAvailableAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableAdvicesResponseBody(name='body'),
}

/**
 * @summary Queries the available optimization suggestions for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAvailableAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableAdvicesResponse
 */
async function describeAvailableAdvicesWithOptions(request: DescribeAvailableAdvicesRequest, runtime: Util.RuntimeOptions): DescribeAvailableAdvicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceDate)) {
    query['AdviceDate'] = request.adviceDate;
  }
  if (!Util.isUnset(request.adviceType)) {
    query['AdviceType'] = request.adviceType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaTableName)) {
    query['SchemaTableName'] = request.schemaTableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableAdvices',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the available optimization suggestions for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAvailableAdvicesRequest
 * @return DescribeAvailableAdvicesResponse
 */
async function describeAvailableAdvices(request: DescribeAvailableAdvicesRequest): DescribeAvailableAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableAdvicesWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-uf6s7oa710rbu0x3b'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeBackupPolicyResponseBody = {
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod', description='The number of days for which data backup files are retained.', example='7'),
  enableBackupLog?: string(name='EnableBackupLog', description='Indicates whether log backup is enabled. Valid values:

*   **Enable**
*   **Disable**', example='true'),
  logBackupRetentionPeriod?: int32(name='LogBackupRetentionPeriod', description='The number of days for which the log backup files are retained.', example='7'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The cycle based on which backups are performed. If more than one day of the week is specified, the days of the week are separated by commas (,). Valid value:

*   Monday
*   Tuesday
*   Wednesday
*   Thursday
*   Friday
*   Saturday
*   Sunday', example='Wednesday,Saturday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The data backup time. The time is in the HH:mmZ-HH:mmZ format. The time is displayed in UTC.', example='15:00Z-16:00Z'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupPolicyResponseBody(name='body'),
}

/**
 * @summary 查看集群备份设置
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: Util.RuntimeOptions): DescribeBackupPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupPolicy',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看集群备份设置
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeBackupPolicyRequest
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeBackupsRequest {
  backupId?: string(name='BackupId', description='The backup set ID.', example='1679758862'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='am-bp18934i73vb5****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The end time must be later than the start time.

This parameter is required.', example='2023-02-20T02:30Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

This parameter is required.', example='2011-06-01T16:00Z'),
}

model DescribeBackupsResponseBody = {
  freeBackupSize?: long(name='FreeBackupSize'),
  items?: {
    backup?: [ 
    {
      backupEndTime?: string(name='BackupEndTime', description='The end time of the backup.', example='2022-06-02T16:00Z'),
      backupExpiredTime?: string(name='BackupExpiredTime'),
      backupId?: string(name='BackupId', description='The backup set ID.', example='32732****'),
      backupMethod?: string(name='BackupMethod', description='The backup method. Snapshot is returned.', example='Snapshot'),
      backupSize?: int32(name='BackupSize', description='The size of the backup set. Unit: bytes.', example='2167808'),
      backupStartTime?: string(name='BackupStartTime', description='The start time of the backup.', example='2022-06-01T16:00Z'),
      backupType?: string(name='BackupType', description='The backup type. Valid values:

*   **FullBackup**
*   **IncrementalBackup**', example='FullBackup'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='am-bp11q28kvl688****'),
    }
  ](name='Backup')
  }(name='Items', description='The queried backup sets.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='CE17270B-F8F8-5A31-9DB4-DADDFDAD7940'),
  totalBackupSize?: long(name='TotalBackupSize'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='300'),
}

model DescribeBackupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupsResponseBody(name='body'),
}

/**
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeBackupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupsResponse
 */
async function describeBackupsWithOptions(request: DescribeBackupsRequest, runtime: Util.RuntimeOptions): DescribeBackupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackups',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeBackupsRequest
 * @return DescribeBackupsResponse
 */
async function describeBackups(request: DescribeBackupsRequest): DescribeBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupsWithOptions(request, runtime);
}

model DescribeBadSqlDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-xxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2024-11-17T02:16Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2022-01-23T02:18Z'),
}

model DescribeBadSqlDetectionResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-xxxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='SQL statements that result in high peak memory are detected.'),
      name?: string(name='Name', description='The name of the detection item.', example='Cost'),
      results?: [ 
        {
          cost?: long(name='Cost', description='The total execution duration. Unit: milliseconds.

>  This value is the cumulative value of the `QueuedTime`, `TotalPlanningTime`, and `ExecutionTime` parameters.', example='709'),
          diagnosisResults?: [ 
            {
              code?: string(name='Code', description='The diagnostic code.', example='Large amounts of data are returned to the client.'),
              detail?: string(name='Detail', description='The information about the diagnostic result.', example='Large amounts of data are returned to the client. Import the data to OSS.'),
              operatorId?: string(name='OperatorId', description='The operator ID.', example='TableScan[234]'),
              stageId?: string(name='StageId', description='The stage ID.', example='Stage[67]'),
            }
          ](name='DiagnosisResults', description='The diagnostic result items.'),
          operatorCost?: long(name='OperatorCost', description='The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.', example='2345'),
          outputDataSize?: long(name='OutputDataSize', description='The amount of returned data. Unit: bytes.', example='235433'),
          patternId?: string(name='PatternId', description='The SQL pattern ID.', example='3467484070025860498'),
          peakMemory?: long(name='PeakMemory', description='The peak memory. Unit: bytes.', example='234'),
          processId?: string(name='ProcessId', description='The query ID.', example='202410161002191720161451770345363xxxx'),
          SQL?: string(name='SQL', description='The SQL statement.

>  For performance considerations, an SQL statement cannot exceed 5,120 characters in length. Otherwise, the SQL statement is truncated. You can call the [DownloadDiagnosisRecords](https://help.aliyun.com/document_detail/308212.html) operation to download the information about SQL statements that meet a query condition for an AnalyticDB for MySQL cluster, including the complete SQL statements.', example='SELECT * FROM device WHERE product_key = \\\\"h66zXfxet2X\\\\" AND name = \\\\"device@zntbtfptv5_9237117\\\\"'),
          scanSize?: long(name='ScanSize', description='The amount of scanned data. Unit: bytes.', example='2342'),
          startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2024-09-06T02:11:00Z'),
          totalStages?: int32(name='TotalStages', description='The total number of stages generated.', example='5'),
        }
      ](name='Results', description='The detection result items.'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='584CFCAE-E3C8-5BBB-B46C-724E77A830A7'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='50'),
}

model DescribeBadSqlDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBadSqlDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the bad SQL statements that affect cluster stability within a time range.
 *
 * @param request DescribeBadSqlDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBadSqlDetectionResponse
 */
async function describeBadSqlDetectionWithOptions(request: DescribeBadSqlDetectionRequest, runtime: Util.RuntimeOptions): DescribeBadSqlDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBadSqlDetection',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the bad SQL statements that affect cluster stability within a time range.
 *
 * @param request DescribeBadSqlDetectionRequest
 * @return DescribeBadSqlDetectionResponse
 */
async function describeBadSqlDetection(request: DescribeBadSqlDetectionRequest): DescribeBadSqlDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBadSqlDetectionWithOptions(request, runtime);
}

model DescribeClusterAccessWhiteListRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model DescribeClusterAccessWhiteListResponseBody = {
  items?: {
    IPArray?: [ 
    {
      DBClusterIPArrayAttribute?: string(name='DBClusterIPArrayAttribute', description='The attribute of the whitelist.

> Whitelists with the **hidden** attribute are not displayed in the console. Those whitelists are used to access Data Transmission Service (DTS) and PolarDB.', example='hidden'),
      DBClusterIPArrayName?: string(name='DBClusterIPArrayName', description='The name of the IP address whitelist.

Each cluster supports up to 50 IP address whitelists.', example='test'),
      securityIPList?: string(name='SecurityIPList', description='The IP addresses in the IP address whitelist. Up to 500 IP addresses can be returned. Multiple IP addresses are separated by commas (,).', example='127.0.xx.xx'),
    }
  ](name='IPArray')
  }(name='Items', description='The queried IP address whitelists.'),
  requestId?: string(name='RequestId', description='The request ID.', example='370D09FD-442A-5225-AAD3-7362CAE39177'),
}

model DescribeClusterAccessWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterAccessWhiteListResponseBody(name='body'),
}

/**
 * @summary Queries the IP address whitelists of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterAccessWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterAccessWhiteListResponse
 */
async function describeClusterAccessWhiteListWithOptions(request: DescribeClusterAccessWhiteListRequest, runtime: Util.RuntimeOptions): DescribeClusterAccessWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClusterAccessWhiteList',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the IP address whitelists of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterAccessWhiteListRequest
 * @return DescribeClusterAccessWhiteListResponse
 */
async function describeClusterAccessWhiteList(request: DescribeClusterAccessWhiteListRequest): DescribeClusterAccessWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClusterAccessWhiteListWithOptions(request, runtime);
}

model DescribeClusterNetInfoRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-wz9dqvn0o7****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
}

model DescribeClusterNetInfoResponseBody = {
  clusterNetworkType?: string(name='ClusterNetworkType', description='The network type of the cluster. Only the Virtual Private Cloud (VPC) network type is supported. **VPC** is returned.', example='VPC'),
  items?: {
    address?: [ 
    {
      connectionString?: string(name='ConnectionString', description='The endpoint of the cluster.

*   If NetType is set to VPC, the VPC endpoint of the cluster is returned.
*   If NetType is set to Public, the public endpoint of the cluster is returned.', example='amv-wz9dqvn0o7****.ads.aliyuncs.com'),
      connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the endpoint.

*   If NetType is set to VPC, the prefix of the VPC endpoint is returned.
*   If NetType is set to Public, the prefix of the public endpoint is returned.', example='amv-wz9dqvn0o7****'),
      IPAddress?: string(name='IPAddress', description='The IP address of the endpoint.

*   If NetType is set to VPC, the private IP address of the cluster is returned.
*   If NetType is set to Public, the public IP address of the cluster is returned.', example='192.168.xx.xx'),
      netType?: string(name='NetType', description='The network type of the cluster. Valid values:

*   **Public**: Internet.
*   **VPC**: VPC.', example='VPC'),
      port?: string(name='Port', description='The port number that is used to connect to the cluster. **3306** is returned.', example='3306'),
      ports?: {
        ports?: [ 
        {
          port?: string(name='Port', description='The port.', example='3306'),
          protocol?: string(name='Protocol', description='The type of the protocol. Valid values:

*   **tcp**
*   **http**
*   **https**
*   **mysql**', example='mysql'),
        }
      ](name='ports')
      }(name='Ports', description='The ports.'),
      VPCId?: string(name='VPCId', description='The VPC ID.

>  If NetType is set to Public, an empty string is returned.', example='vpc-8vbhucmd5b****'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.

>  If NetType is set to Public, an empty string is returned.', example='vsw-bp1syh8vvw8yec****'),
    }
  ](name='Address')
  }(name='Items', description='The queried network information about the cluster.'),
  requestId?: string(name='RequestId', description='The request ID.', example='69A29B65-CD0C-52B1-BE42-8B454569747F'),
}

model DescribeClusterNetInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterNetInfoResponseBody(name='body'),
}

/**
 * @summary Queries the network information about an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterNetInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterNetInfoResponse
 */
async function describeClusterNetInfoWithOptions(request: DescribeClusterNetInfoRequest, runtime: Util.RuntimeOptions): DescribeClusterNetInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClusterNetInfo',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the network information about an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterNetInfoRequest
 * @return DescribeClusterNetInfoResponse
 */
async function describeClusterNetInfo(request: DescribeClusterNetInfoRequest): DescribeClusterNetInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClusterNetInfoWithOptions(request, runtime);
}

model DescribeClusterResourceDetailRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1jj9xqft1po****'),
}

model DescribeClusterResourceDetailResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    computeResource?: string(name='ComputeResource', description='The amount of reserved computing resources. Unit: AnalyticDB compute units (ACUs). Valid values: 0 to 4096. The value must be in increments of 16 ACUs. Each ACU is equivalent to 1 core and 4 GB memory.', example='16ACU'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-adbxxxxx'),
    freeComputeResource?: string(name='FreeComputeResource', description='The amount of idle reserved computing resources. Unit: ACUs. Valid values: 0 to 4096. The value must be in increments of 16 ACUs. Each ACU is equivalent to 1 core and 4 GB memory.', example='0ACU'),
    resourceGroupList?: [ 
      {
        clusterMode?: string(name='ClusterMode', description='A reserved parameter.

This parameter is required.', example='0'),
        clusterSizeResource?: string(name='ClusterSizeResource', description='A reserved parameter.', example='0'),
        enableSpot?: boolean(name='EnableSpot', description='Indicates whether the preemptible instance feature is enabled for the resource group. After the preemptible instance feature is enabled, you are charged for resources at a lower unit price but the resources are probably released. Valid values:

*   **true**
*   **false**

The True value is returned only for job resource groups.', example='true'),
        maxClusterCount?: int32(name='MaxClusterCount', description='A reserved parameter.', example='0'),
        maxComputeResource?: string(name='MaxComputeResource', description='The maximum amount of reserved computing resources.', example='128ACU'),
        minClusterCount?: int32(name='MinClusterCount', description='A reserved parameter.', example='0'),
        minComputeResource?: string(name='MinComputeResource', description='The minimum amount of reserved computing resources.', example='16ACU'),
        poolId?: long(name='PoolId', description='The resource group ID.', example='17'),
        poolName?: string(name='PoolName', description='The name of the resource group.', example='testadb'),
        poolType?: string(name='PoolType', description='The type of the resource group.', example='interactive'),
        poolUsers?: string(name='PoolUsers', description='The user of the resource group.', example='user1'),
        runningClusterCount?: int32(name='RunningClusterCount', description='A reserved parameter.', example='0'),
        status?: string(name='Status', description='The status of the resource group. Valid values:

*   **running**
*   **deleting**
*   **scaling**', example='running'),
      }
    ](name='ResourceGroupList', description='The resource groups.'),
    storageResource?: string(name='StorageResource', description='The amount of reserved storage resources. Unit: ACUs. Valid values: 0 to 2064. The value must be in increments of 24 ACUs. Each ACU is equivalent to 1 core and 4 GB memory.', example='24ACU'),
  }(name='Data', description='The queried resource usage.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeClusterResourceDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterResourceDetailResponseBody(name='body'),
}

/**
 * @summary Queries the information about resource usage of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterResourceDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterResourceDetailResponse
 */
async function describeClusterResourceDetailWithOptions(request: DescribeClusterResourceDetailRequest, runtime: Util.RuntimeOptions): DescribeClusterResourceDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClusterResourceDetail',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about resource usage of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterResourceDetailRequest
 * @return DescribeClusterResourceDetailResponse
 */
async function describeClusterResourceDetail(request: DescribeClusterResourceDetailRequest): DescribeClusterResourceDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClusterResourceDetailWithOptions(request, runtime);
}

model DescribeClusterResourceUsageRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp11q28kvl688****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2022-08-22T01:06:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

This parameter is required.', example='2022-11-29T10:20Z'),
}

model DescribeClusterResourceUsageResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    acuInfo?: [ 
      {
        name?: string(name='Name', description='The resource usage metric. Valid values:

*   `TotalAcuNumber`: the total number of ACUs.
*   `ReservedAcuNumber`: the number of ACUs for the reserved resources.
*   `ReservedAcuUsageNumber`: the number of ACUs for the reserved resources that are used.', example='TotalAcuNumber'),
        values?: [ string ](name='Values', description='The values of the metric at specific points in time.'),
      }
    ](name='AcuInfo', description='The AnalyticDB compute unit (ACU) usage of the cluster.'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-uf6dj23rt5zo9s9d'),
    endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2023-03-23T02:31Z'),
    startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2023-03-14T03:42:15Z'),
  }(name='Data', description='The queried resource usage.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEAW'),
}

model DescribeClusterResourceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterResourceUsageResponseBody(name='body'),
}

/**
 * @summary Queries the resource usage of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterResourceUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterResourceUsageResponse
 */
async function describeClusterResourceUsageWithOptions(request: DescribeClusterResourceUsageRequest, runtime: Util.RuntimeOptions): DescribeClusterResourceUsageResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClusterResourceUsage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resource usage of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeClusterResourceUsageRequest
 * @return DescribeClusterResourceUsageResponse
 */
async function describeClusterResourceUsage(request: DescribeClusterResourceUsageRequest): DescribeClusterResourceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClusterResourceUsageWithOptions(request, runtime);
}

model DescribeColumnsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1xxxxxxxx47'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model DescribeColumnsResponseBody = {
  items?: {
    column?: [ 
    {
      autoIncrementColumn?: boolean(name='AutoIncrementColumn', description='Indicates whether the column is an auto-increment column. Valid values:

*   **true**
*   **false**', example='true'),
      columnName?: string(name='ColumnName', description='The name of the column.', example='id'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp111m2cfrdl1****'),
      primaryKey?: boolean(name='PrimaryKey', description='Indicates whether the column is the primary key of the table. Valid values:

*   **true**
*   **false**', example='false'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
      type?: string(name='Type', description='The data type of the column.', example='bigint'),
    }
  ](name='Column')
  }(name='Items', description='The queried columns.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-XXX442913CEF'),
}

model DescribeColumnsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeColumnsResponseBody(name='body'),
}

/**
 * @summary Queries a list of columns in a table.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeColumnsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeColumnsResponse
 */
async function describeColumnsWithOptions(request: DescribeColumnsRequest, runtime: Util.RuntimeOptions): DescribeColumnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeColumns',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of columns in a table.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeColumnsRequest
 * @return DescribeColumnsResponse
 */
async function describeColumns(request: DescribeColumnsRequest): DescribeColumnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeColumnsWithOptions(request, runtime);
}

model DescribeCompactionServiceSwitchRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp149vz49b36t****'),
}

model DescribeCompactionServiceSwitchResponseBody = {
  data?: {
    enableCompactionService?: boolean(name='EnableCompactionService', description='Indicates whether the remote build feature is enabled.

Valid values:

*   true
*   false', example='true'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D761DA51-12F8-5457-AAA9-F52B9F436D2D'),
}

model DescribeCompactionServiceSwitchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCompactionServiceSwitchResponseBody(name='body'),
}

/**
 * @summary Queries whether the remote build feature is enabled in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeCompactionServiceSwitchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCompactionServiceSwitchResponse
 */
async function describeCompactionServiceSwitchWithOptions(request: DescribeCompactionServiceSwitchRequest, runtime: Util.RuntimeOptions): DescribeCompactionServiceSwitchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCompactionServiceSwitch',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether the remote build feature is enabled in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeCompactionServiceSwitchRequest
 * @return DescribeCompactionServiceSwitchResponse
 */
async function describeCompactionServiceSwitch(request: DescribeCompactionServiceSwitchRequest): DescribeCompactionServiceSwitchResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCompactionServiceSwitchWithOptions(request, runtime);
}

model DescribeComputeResourceUsageRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

This parameter is required.', example='2023-02-05T03:45:00Z'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

This parameter is required.', example='test'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2023-02-04T03:45:00Z'),
}

model DescribeComputeResourceUsageResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    acuInfo?: [ 
      {
        name?: string(name='Name', description='The resource usage metric. Valid values:

*   `TotalAcuNumber`: the total number of ACUs.
*   `ReservedAcuNumber`: the number of ACUs for the reserved resources.
*   `ReservedAcuUsageNumber`: the number of ACUs for the reserved resources that are used.', example='TotalAcuNumber'),
        values?: [ string ](name='Values', description='The values of the metric at specific points in time.'),
      }
    ](name='AcuInfo', description='The AnalyticDB compute unit (ACU) usage of the cluster.'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-clusterxxx'),
    endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2023-06-07T02:37:00Z'),
    resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.', example='test'),
    resourceGroupType?: string(name='ResourceGroupType', description='The type of the resource group.', example='interative'),
    startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-04-24T07:00:00Z'),
  }(name='Data', description='The queried resource usage.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEAW'),
}

model DescribeComputeResourceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeComputeResourceUsageResponseBody(name='body'),
}

/**
 * @summary Queries the computing resource usage of a resource group in an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeComputeResourceUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeComputeResourceUsageResponse
 */
async function describeComputeResourceUsageWithOptions(request: DescribeComputeResourceUsageRequest, runtime: Util.RuntimeOptions): DescribeComputeResourceUsageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeComputeResourceUsage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the computing resource usage of a resource group in an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeComputeResourceUsageRequest
 * @return DescribeComputeResourceUsageResponse
 */
async function describeComputeResourceUsage(request: DescribeComputeResourceUsageRequest): DescribeComputeResourceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeComputeResourceUsageWithOptions(request, runtime);
}

model DescribeControllerDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> 

*   You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/98094.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-xxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the **yyyy-MM-ddTHH:mmZ** format. The time must be in UTC.

>  The end time must be later than the start time. The maximum time range that can be specified is 30 days.', example='2024-06-23T02:21Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2022-03-10T23:56Z'),
}

model DescribeControllerDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-xxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='A CPU increase is detected on the access node.'),
      name?: string(name='Name', description='The name of the detection item.', example='CPU increase detection'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='NORMAL
WARNING
CRITICAL'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='257FAE29-ED5F-586C-94E4-43BD1392F238'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeControllerDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeControllerDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic results of the access layer.
 *
 * @param request DescribeControllerDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeControllerDetectionResponse
 */
async function describeControllerDetectionWithOptions(request: DescribeControllerDetectionRequest, runtime: Util.RuntimeOptions): DescribeControllerDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeControllerDetection',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic results of the access layer.
 *
 * @param request DescribeControllerDetectionRequest
 * @return DescribeControllerDetectionResponse
 */
async function describeControllerDetection(request: DescribeControllerDetectionRequest): DescribeControllerDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeControllerDetectionWithOptions(request, runtime);
}

model DescribeDBClusterAttributeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
}

model DescribeDBClusterAttributeResponseBody = {
  items?: {
    DBCluster?: [ 
    {
      clickhouseEngineCacheSize?: int32(name='ClickhouseEngineCacheSize', description='The cache size of the ClickHouse wide table engine. Unit: GB. If a value of -1 is returned, the ClickHouse wide table engine is disabled. If a value other than -1 is returned, this parameter indicates the disk cache size.', example='100'),
      clickhouseEngineEnabled?: boolean(name='ClickhouseEngineEnabled', description='Indicates whether the ClickHouse wide table engine is enabled. Valid values:

*   **true**
*   **false**', example='true'),
      commodityCode?: string(name='CommodityCode', description='The billing method of the cluster. Valid values:

*   **ads**: pay-as-you-go.
*   **ads_pre**: subscription.', example='ads_pre'),
      computeResource?: string(name='ComputeResource', description='The specifications of reserved computing resources. Each ACU is approximately equal to 1 core and 4 GB memory. Computing resources are used to compute data. The increase in the computing resources can accelerate queries. You can scale computing resources based on your business requirements.', example='16ACU'),
      computeResourceTotal?: string(name='ComputeResourceTotal', description='The total amount of computing resources in the cluster. Each ACU is approximately equal to 1 core and 4 GB memory.', example='48ACU'),
      connectionString?: string(name='ConnectionString', description='The public endpoint that is used to connect to the cluster.', example='amv-wz9509beptiz****.ads.aliyuncs.com'),
      creationTime?: string(name='CreationTime', description='The time when the cluster was created. The time follows the ISO 8601 standard in the `YYYY-MM-DDThh:mm:ssZ` format. The time is displayed in UTC.', example='2022-07-01T09:50:18Z'),
      DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.', example='adb_test'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.', example='amv-wz9509beptiz****'),
      DBClusterNetworkType?: string(name='DBClusterNetworkType', description='The network type of the cluster. **VPC** is returned.', example='VPC'),
      DBClusterStatus?: string(name='DBClusterStatus', description='The status of the cluster. Valid values:

*   **Preparing**
*   **Creating**
*   **Running**
*   **Deleting**
*   **Restoring**
*   **ClassChanging**
*   **NetAddressCreating**
*   **NetAddressDeleting**
*   **NetAddressModifying**', example='Running'),
      DBClusterType?: string(name='DBClusterType', description='The type of the cluster. By default, **Common** is returned, which indicates a common cluster.', example='Common'),
      DBVersion?: string(name='DBVersion', description='The engine version of the AnalyticDB for MySQL Data Lakehouse Edition cluster. **5.0** is returned.', example='5.0'),
      diskEncryption?: boolean(name='DiskEncryption'),
      engine?: string(name='Engine', description='The engine of the cluster. **AnalyticDB** is returned.', example='AnalyticDB'),
      engineVersion?: string(name='EngineVersion', description='The minor version of the cluster.', example='3.1.16'),
      expireTime?: string(name='ExpireTime', description='The time when the cluster expires.

*   If the billing method of the cluster is subscription, the actual expiration time is returned.
*   If the billing method of the cluster is pay-as-you-go, null is returned.', example='2022-10-01T09:50:18Z'),
      expired?: string(name='Expired', description='Indicates whether the subscription cluster has expired. Valid values:

*   **true**
*   **false**

> 

*   If the cluster has expired, the system locks or releases the cluster within a period of time. We recommend that you renew the expired cluster. For more information, see [Renewal policy](https://help.aliyun.com/document_detail/135248.html).

*   This parameter is not returned for pay-as-you-go clusters.', example='false'),
      kmsId?: string(name='KmsId', description='The ID of the key that is used to encrypt disk data.

>  This parameter is returned only when disk encryption is enabled.', example='e1935511-cf88-1123-a0f8-1be8d251****'),
      lockMode?: string(name='LockMode', description='The lock mode of the cluster. Valid values:

*   **Unlock**: The cluster is not locked.
*   **ManualLock**: The cluster is manually locked.
*   **LockByExpiration**: The cluster is automatically locked due to cluster expiration.', example='ManualLock'),
      lockReason?: string(name='LockReason', description='The reason why the cluster is locked.

>  This parameter is returned only when the cluster was locked. **instance_expire** is returned.', example='instance_expire'),
      maintainTime?: string(name='MaintainTime', description='The maintenance window of the cluster. The time is displayed in the `HH:mmZ-HH:mmZ` format in UTC.

>  For more information about maintenance windows, see [Configure a maintenance window](https://help.aliyun.com/document_detail/122569.html).', example='04:00Z-05:00Z'),
      mode?: string(name='Mode', description='The mode of the cluster. By default, **flexible** is returned, which indicates that the cluster is in elastic mode.', example='flexible'),
      payType?: string(name='PayType', description='The billing method of the cluster. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='Prepaid'),
      port?: int32(name='Port', description='The port number that is used to connect to the cluster.', example='3306'),
      productForm?: string(name='ProductForm', description='A reserved parameter.', example='N/A'),
      productVersion?: string(name='ProductVersion', description='The edition of the cluster. Valid values:

*   **BasicVersion**: Basic Edition.
*   **EnterpriseVersion**: Enterprise Edition.', example='BasicVersion'),
      regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
      reservedACU?: string(name='ReservedACU', description='The amount of remaining reserved computing resources that are available in the cluster. Each ACU is approximately equal to 1 core and 4 GB memory.', example='24ACU'),
      reservedNodeCount?: int32(name='ReservedNodeCount', description='A reserved parameter.', example='N/A'),
      reservedNodeSize?: string(name='ReservedNodeSize', description='A reserved parameter.', example='N/A'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmyiu4ekp****'),
      secondaryVSwitchId?: string(name='SecondaryVSwitchId'),
      secondaryZoneId?: string(name='SecondaryZoneId'),
      storageResource?: string(name='StorageResource', description='The specifications of reserved storage resources. Each AnalyticDB compute unit (ACU) is approximately equal to 1 core and 4 GB memory. Storage resources are used to read and write data. The increase in the storage resources can improve the read and write performance of the cluster.', example='24ACU'),
      storageResourceTotal?: string(name='StorageResourceTotal', description='The total amount of storage resources in the cluster. Each ACU is approximately equal to 1 core and 4 GB memory.', example='24ACU'),
      supportedFeatures?: map[string]string(name='SupportedFeatures', description='Reserved parameters.'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.

>  You can call the [TagResources](https://help.aliyun.com/document_detail/179253.html) operation to add tags to a cluster.', example='tag1'),
          value?: string(name='Value', description='The tag value.', example='test1'),
        }
      ](name='Tag')
      }(name='Tags', description='The tags that are added to the cluster.'),
      taskInfo?: {
        name?: string(name='Name', description='The name of the job.', example='ScaleUpDBCluster'),
        progress?: string(name='Progress', description='The progress of the job. Unit: %.', example='10'),
        status?: string(name='Status', description='The status of the job. Valid values:

*   NOT_RUN
*   RUNNING
*   SUCCEED', example='RUNNING'),
        stepList?: {
          stepList?: [ 
          {
            endTime?: string(name='EndTime', description='The end time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T10:28:34Z'),
            startTime?: string(name='StartTime', description='The start time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T09:28:34Z'),
            stepDesc?: string(name='StepDesc', description='The description of the job step.', example='Prepare resources'),
            stepName?: string(name='StepName', description='The name of the job step.', example='PrepareResources'),
            stepProgress?: string(name='StepProgress', description='The progress of the job step. Unit: %.', example='50'),
            stepStatus?: string(name='StepStatus', description='The status of the job step. Valid values:

*   NOT_RUN
*   RUNNING
*   SUCCEED', example='RUNNING'),
          }
        ](name='StepList')
        }(name='StepList', description='The job steps.'),
      }(name='TaskInfo', description='The job information.'),
      userENIStatus?: boolean(name='UserENIStatus', description='Indicates whether Elastic Network Interface (ENI) is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      userENIVSwitchOptions?: string(name='UserENIVSwitchOptions', description='The vSwitch connected to the ENI. Separate multiple vSwitches with commas (,).', example='vsw-rj9ixufmywqq98z******,vsw-rj95ij6wcz656v7******'),
      userENIVpcId?: string(name='UserENIVpcId', description='The VPC information of the ENI.', example='vpc-rj9hnedlfm645uj******'),
      userENIZoneOptions?: string(name='UserENIZoneOptions', description='The zone associated with the ENI. Separate multiple zones with commas (,).', example='cn-hangzhou-k,cn-hangzhou-h'),
      VPCId?: string(name='VPCId', description='The virtual private cloud (VPC) ID of the cluster.', example='vpc-bp13h7uzhulpu****'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.', example='vsw-uf629gydd54ld****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the cluster.', example='cn-hangzhou-h'),
    }
  ](name='DBCluster')
  }(name='Items', description='The queried cluster.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
}

model DescribeDBClusterAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the information about an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterAttributeResponse
 */
async function describeDBClusterAttributeWithOptions(request: DescribeDBClusterAttributeRequest, runtime: Util.RuntimeOptions): DescribeDBClusterAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterAttribute',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterAttributeRequest
 * @return DescribeDBClusterAttributeResponse
 */
async function describeDBClusterAttribute(request: DescribeDBClusterAttributeRequest): DescribeDBClusterAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterAttributeWithOptions(request, runtime);
}

model DescribeDBClusterHealthStatusRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-uf6o6m8p6x7v****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDBClusterHealthStatusResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  CS?: {
    activeCount?: long(name='ActiveCount', description='The number of healthy access nodes.', example='2'),
    expectedCount?: long(name='ExpectedCount', description='The total number of access nodes.', example='2'),
    riskCount?: long(name='RiskCount', description='The number of risky nodes.', example='0'),
    status?: string(name='Status', description='The health state of access nodes. Valid values:

*   **RISK**
*   **NORMAL**
*   **UNAVAILABLE**', example='NORMAL'),
    unavailableCount?: long(name='UnavailableCount', description='The number of unavailable access nodes.', example='0'),
  }(name='CS', description='The access nodes of the queried cluster.'),
  executor?: {
    activeCount?: long(name='ActiveCount', description='The number of healthy access nodes.', example='2'),
    expectedCount?: long(name='ExpectedCount', description='The total number of compute nodes.', example='2'),
    riskCount?: long(name='RiskCount', description='The number of risky nodes.', example='0'),
    status?: string(name='Status', description='The health state of compute node groups. Valid values:

*   **RISK**
*   **NORMAL**
*   **UNAVAILABLE**', example='NORMAL'),
    unavailableCount?: long(name='UnavailableCount', description='The number of unavailable access nodes.', example='0'),
  }(name='Executor', description='The compute node groups of the queried cluster.'),
  instanceStatus?: string(name='InstanceStatus', description='The health state of the cluster. Valid values:

*   **RISK**
*   **NORMAL**
*   **UNAVAILABLE**

>  When the states of the access nodes, compute node groups, and storage node groups of a cluster are all **NORMAL** and a connection to the cluster is established, the state of the cluster is **NORMAL**. When the state of the access nodes, compute node groups, or storage node groups of the cluster is **RISK**, the state of the cluster is **RISK**. When the state of the access nodes, compute node groups, or storage node groups of the cluster is **UNAVAILABLE**, the state of the cluster is **UNAVAILABLE**.', example='NORMAL'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEA'),
  worker?: {
    activeCount?: long(name='ActiveCount', description='The number of healthy storage node groups.', example='2'),
    expectedCount?: long(name='ExpectedCount', description='The total number of storage node groups.', example='2'),
    riskCount?: long(name='RiskCount', description='The number of risky storage node groups.', example='0'),
    status?: string(name='Status', description='The health state of storage node groups. Valid values:

*   **RISK**
*   **NORMAL**
*   **UNAVAILABLE**', example='NORMAL'),
    unavailableCount?: long(name='UnavailableCount', description='The number of unavailable storage node groups.', example='0'),
  }(name='Worker', description='The storage node groups of the queried cluster.'),
}

model DescribeDBClusterHealthStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterHealthStatusResponseBody(name='body'),
}

/**
 * @summary Queries the health status of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterHealthStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterHealthStatusResponse
 */
async function describeDBClusterHealthStatusWithOptions(request: DescribeDBClusterHealthStatusRequest, runtime: Util.RuntimeOptions): DescribeDBClusterHealthStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterHealthStatus',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the health status of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterHealthStatusRequest
 * @return DescribeDBClusterHealthStatusResponse
 */
async function describeDBClusterHealthStatus(request: DescribeDBClusterHealthStatusRequest): DescribeDBClusterHealthStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterHealthStatusWithOptions(request, runtime);
}

model DescribeDBClusterPerformanceRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](~~~612397~~~) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp1hx5n1o8f61****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

> The end time must be later than the start time. The maximum time range that can be specified is two days.', example='2022-03-11T15:01Z'),
  key?: string(name='Key', description='The key of the performance metric that you want to query. Separate multiple keys with commas (,). For more information about the performance metrics, see [Metric overview](https://help.aliyun.com/document_detail/2863211.html).', example='AnalyticDB_CPU_Usage_Percentage'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612393.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourcePools?: string(name='ResourcePools', description='The resource group ID.', example='user_default'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2022-03-10T23:56Z'),
}

model DescribeDBClusterPerformanceResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.', example='amv-bp1hx5n1o8f61****'),
  endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time is displayed in UTC.', example='2022-03-11T15:01Z'),
  performances?: [ 
    {
      key?: string(name='Key', description='The name of the performance metric.', example='AnalyticDB_CPU_Usage_Percentage'),
      series?: [ 
        {
          name?: string(name='Name', description='The name of the performance metric value. For more information about the performance metrics, see [Metric overview](https://help.aliyun.com/document_detail/2863211.html).', example='AnalyticDB_Storage_CPU_Avg_Usage_Percentage'),
          tags?: string(name='Tags', description='The tags that are added to the cluster.', example='{instance_name: "am-***"}'),
          translateKey?: string(name='TranslateKey'),
          values?: [ string ](name='Values', description='The values of the performance metric at different points in time.'),
        }
      ](name='Series', description='The queried performance metric data.'),
      unit?: string(name='Unit', description='The unit of the performance metric.', example='%'),
    }
  ](name='Performances', description='The queried performance metrics.'),
  requestId?: string(name='RequestId', description='The request ID.', example='BD8C3096-8BC6-51DF-A4AB-BACD9DC10435'),
  startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time is displayed in UTC.', example='2022-03-10T23:56Z'),
}

model DescribeDBClusterPerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterPerformanceResponseBody(name='body'),
}

/**
 * @summary Queries the performance data of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterPerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterPerformanceResponse
 */
async function describeDBClusterPerformanceWithOptions(request: DescribeDBClusterPerformanceRequest, runtime: Util.RuntimeOptions): DescribeDBClusterPerformanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourcePools)) {
    query['ResourcePools'] = request.resourcePools;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterPerformance',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the performance data of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterPerformanceRequest
 * @return DescribeDBClusterPerformanceResponse
 */
async function describeDBClusterPerformance(request: DescribeDBClusterPerformanceRequest): DescribeDBClusterPerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterPerformanceWithOptions(request, runtime);
}

model DescribeDBClusterSpaceSummaryRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-wz9v5sa7mm79z4l2'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBClusterSpaceSummaryResponseBody = {
  data?: {
    coldData?: {
      dataSize?: long(name='DataSize', description='The data size of table records. Unit: bytes.', example='1048576'),
      indexSize?: long(name='IndexSize', description='The data size of regular indexes. Unit: bytes.', example='1048576'),
      otherSize?: long(name='OtherSize', description='The data size of other data. Unit: bytes.', example='1048576'),
      primaryKeyIndexSize?: long(name='PrimaryKeyIndexSize', description='The data size of primary key indexes. Unit: bytes.', example='1048576'),
      totalSize?: long(name='TotalSize', description='The cold data size. Unit: bytes.

>  Formula: Cold data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Data size of other data.', example='4194304'),
    }(name='ColdData', description='The cold data.'),
    dataGrowth?: {
      dayGrowth?: long(name='DayGrowth', description='The data growth within the last day. Unit: bytes.

>  Formula: Data growth within the last day = Current data size - Data size one day ago.', example='1048576'),
      weekGrowth?: long(name='WeekGrowth', description='The daily data growth within the last seven days. Unit: bytes.

>  Formula: Daily data growth within the last seven days = (Current data size - Data size seven days ago)/7.', example='1048576'),
    }(name='DataGrowth', description='The data growth.'),
    hotData?: {
      dataSize?: long(name='DataSize', description='The data size of table records. Unit: bytes.', example='1048576'),
      indexSize?: long(name='IndexSize', description='The data size of regular indexes. Unit: bytes.', example='1048576'),
      otherSize?: long(name='OtherSize', description='The data size of other data. Unit: bytes.', example='1048576'),
      primaryKeyIndexSize?: long(name='PrimaryKeyIndexSize', description='The data size of primary key indexes. Unit: bytes.', example='1048576'),
      totalSize?: long(name='TotalSize', description='The hot data size. Unit: bytes.

>  Formula: Hot data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Data size of other data.', example='4194304'),
    }(name='HotData', description='The hot data.'),
    totalSize?: string(name='TotalSize', description='The total data size. Unit: bytes.

>  Formula: Total data size = Hot data size+ Cold data size.', example='8388608'),
  }(name='Data', description='The queried storage overview information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeDBClusterSpaceSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterSpaceSummaryResponseBody(name='body'),
}

/**
 * @summary Queries the storage overview information of an AnalyticDB for MySQL cluster, such as the total data size, hot data size, cold data size, and data growth.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterSpaceSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterSpaceSummaryResponse
 */
async function describeDBClusterSpaceSummaryWithOptions(request: DescribeDBClusterSpaceSummaryRequest, runtime: Util.RuntimeOptions): DescribeDBClusterSpaceSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterSpaceSummary',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the storage overview information of an AnalyticDB for MySQL cluster, such as the total data size, hot data size, cold data size, and data growth.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterSpaceSummaryRequest
 * @return DescribeDBClusterSpaceSummaryResponse
 */
async function describeDBClusterSpaceSummary(request: DescribeDBClusterSpaceSummaryRequest): DescribeDBClusterSpaceSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterSpaceSummaryWithOptions(request, runtime);
}

model DescribeDBClusterStatusRequest {
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDBClusterStatusResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEAU'),
  status?: [ string ](name='Status', description='The queried cluster states.'),
}

model DescribeDBClusterStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterStatusResponseBody(name='body'),
}

/**
 * @summary Queries the statuses of AnalyticDB for MySQL clusters within a region.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterStatusResponse
 */
async function describeDBClusterStatusWithOptions(request: DescribeDBClusterStatusRequest, runtime: Util.RuntimeOptions): DescribeDBClusterStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterStatus',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statuses of AnalyticDB for MySQL clusters within a region.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClusterStatusRequest
 * @return DescribeDBClusterStatusResponse
 */
async function describeDBClusterStatus(request: DescribeDBClusterStatusRequest): DescribeDBClusterStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterStatusWithOptions(request, runtime);
}

model DescribeDBClustersRequest {
  DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.

*   The description cannot start with `http://` or `https://`.
*   The description must be 2 to 256 characters in length', example='test'),
  DBClusterIds?: string(name='DBClusterIds', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

If you do not specify this parameter, the information about all clusters that reside in the region is returned.', example='amv-bp1r053byu48p****'),
  DBClusterStatus?: string(name='DBClusterStatus', description='The state of the cluster. Valid values:

*   **Preparing**

<!---->

*   **Creating**
*   **Running**
*   **Deleting**

<!---->

*   **Restoring**

<!---->

*   **ClassChanging**
*   **NetAddressCreating**
*   **NetAddressDeleting**
*   **NetAddressModifying**', example='Running'),
  DBClusterVersion?: string(name='DBClusterVersion', description='The database engine version of the cluster. Valid values:

*   3.0: Data Warehouse Edition.
*   5.0 (default): Data Lakehouse Edition, Enterprise Edition, and Basic Edition.
*   All: Data Warehouse Edition, Data Lakehouse Edition, Enterprise Edition, and Basic Edition.', example='5.0'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  productVersion?: string(name='ProductVersion', description='The edition of the cluster. Valid values:

*   EnterpriseVersion: Enterprise Edition.
*   BasicVersion: Basic Edition.

If you leave this parameter empty, the information about clusters of all editions is returned.', example='BasicVersion'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID. If you do not specify this parameter, the information about all resource groups in the cluster is returned.', example='rg-4690g37929****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='tag1'),
      value?: string(name='Value', description='The tag value.', example='test1'),
    }
  ](name='Tag', description='The tags that are added to the cluster.'),
}

model DescribeDBClustersResponseBody = {
  items?: {
    DBCluster?: [ 
    {
      category?: string(name='Category', description='The mode of the cluster. This parameter is returned only for Data Warehouse Edition clusters. Valid values:

*   **BASIC**: reserved mode for Basic Edition.
*   **CLUSTER**: reserved mode for Cluster Edition.
*   **MIXED_STORAGE**: elastic mode for Cluster Edition.

>  For more information about cluster editions, see [Editions](https://help.aliyun.com/document_detail/205001.html).', example='MIXED_STORAGE'),
      commodityCode?: string(name='CommodityCode', description='The billing method of the cluster. Valid values:

*   **ads**: pay-as-you-go.
*   **ads_pre**: subscription.', example='ads_pre'),
      computeResource?: string(name='ComputeResource', description='The specifications of reserved computing resources. Each ACU is approximately equal to 1 core and 4 GB memory. Computing resources are used to compute data. The increase in the computing resources can accelerate queries. You can scale computing resources based on your business requirements.', example='16ACU'),
      connectionString?: string(name='ConnectionString', description='The public endpoint that is used to connect to the cluster.', example='amv-bp163885f8q21****.ads.aliyuncs.com'),
      createTime?: string(name='CreateTime', description='The time when the cluster was created. The time follows the ISO 8601 standard in the *yyyy-mm-ddThh:mm:ssZ* format. The time is displayed in UTC.', example='2022-04-01T09:50:18Z'),
      DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.', example='adb_test'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp163885f8q21****'),
      DBClusterNetworkType?: string(name='DBClusterNetworkType', description='The network type of the cluster. **VPC** is returned.', example='VPC'),
      DBClusterStatus?: string(name='DBClusterStatus', description='The status of the cluster. Valid values:

*   **Preparing**

<!---->

*   **Creating**
*   **Running**
*   **Deleting**

<!---->

*   **Restoring**

<!---->

*   **ClassChanging**
*   **NetAddressCreating**
*   **NetAddressDeleting**
*   **NetAddressModifying**', example='Running'),
      DBClusterType?: string(name='DBClusterType', description='The type of the cluster. By default, **Common** is returned, which indicates a common cluster.', example='Common'),
      DBNodeClass?: string(name='DBNodeClass', description='The node specifications of the cluster. This parameter is returned only for Data Warehouse Edition clusters.', example='E8'),
      DBNodeCount?: long(name='DBNodeCount', description='The number of node groups.', example='2'),
      DBNodeStorage?: long(name='DBNodeStorage', description='The storage capacity of the cluster. Unit: GB.', example='300'),
      DBVersion?: string(name='DBVersion', description='The engine version of the AnalyticDB for MySQL Data Lakehouse Edition cluster. **5.0** is returned.', example='5.0'),
      diskType?: string(name='DiskType', description='The disk type of the cluster. Valid values:

*   **local_ssd**: local disk.
*   **cloud**: basic disk.
*   **cloud_ssd**: standard SSD.
*   **cloud_efficiency**: ultra disk.
*   **cloud_essd**: PL1 Enterprise SSD (ESSD).
*   **cloud_essd2**: PL2 ESSD.
*   **cloud_essd3**: PL3 ESSD.

>  For more information about ESSDs, see [ESSDs](https://help.aliyun.com/document_detail/122389.html).', example='cloud_essd'),
      dtsJobId?: string(name='DtsJobId', description='The ID of the Data Transmission Service (DTS) synchronization job This parameter is returned only for MySQL analytic instances.', example='dtsb1578j90XXXX'),
      elasticIOResource?: int32(name='ElasticIOResource', description='The number of elastic I/O units (EIUs). For more information, see the "[EIUs](https://help.aliyun.com/document_detail/189505.html)" section of the Scale out elastic I/O resources topic.

>  This parameter is returned only for clusters in elastic mode.', example='2'),
      engine?: string(name='Engine', description='The engine of the cluster. **AnalyticDB** is returned.', example='AnalyticDB'),
      executorCount?: string(name='ExecutorCount', description='The number of compute nodes that are used by the cluster in elastic mode.', example='1'),
      expireTime?: string(name='ExpireTime', description='The time when the cluster expires. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.

> 

*   If the billing method of the cluster is subscription, the actual expiration time is returned.

*   If the billing method of the cluster is pay-as-you-go, null is returned.', example='2022-07-01T09:50:18Z'),
      expired?: string(name='Expired', description='Indicates whether the subscription cluster has expired. Valid values:

*   **true**
*   **false**

> 

*   If the cluster has expired, the system locks or releases the cluster within a period of time. We recommend that you renew the expired cluster. For more information, see [Renewal policy](https://help.aliyun.com/document_detail/135246.html).

*   This parameter is not returned for pay-as-you-go clusters.', example='false'),
      innerIp?: string(name='InnerIp', description='The internal IP address of the cluster.', example='10.1.xx.xx'),
      innerPort?: string(name='InnerPort', description='The internal port of the cluster.', example='3306'),
      lockMode?: string(name='LockMode', description='The lock status of the cluster. Valid values:

*   **Unlock**: The cluster is not locked.
*   **ManualLock**: The cluster is manually locked.
*   **LockByExpiration**: The cluster is automatically locked due to cluster expiration.', example='Unlock'),
      lockReason?: string(name='LockReason', description='The reason why the cluster is locked.

>  This parameter is returned only when the cluster was locked. **instance_expire** is returned.', example='instance_expire'),
      mode?: string(name='Mode', description='The mode of the cluster. By default, **flexible** is returned, which indicates that the cluster is in elastic mode.', example='flexible'),
      payType?: string(name='PayType', description='The billing method of the cluster. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='Prepaid'),
      port?: string(name='Port', description='The port number that is used to connect to the cluster.', example='3306'),
      productForm?: string(name='ProductForm', description='The service type of the cluster. Valid values:

*   LegacyForm
*   IntegrationForm', example='IntegrationForm'),
      productVersion?: string(name='ProductVersion', description='The edition of the cluster. Valid values:

*   **BasicVersion**: Basic Edition.
*   **EnterpriseVersion**: Enterprise Edition.', example='EnterpriseVersion'),
      rdsInstanceId?: string(name='RdsInstanceId', description='The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is returned only for MySQL analytic instances.', example='rm-bp11q28kvl688****'),
      regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
      reservedACU?: string(name='ReservedACU', description='The remaining reserved computing resources that are available in the cluster. Each ACU is approximately equal to 1 core and 4 GB memory.', example='32ACU'),
      reservedNodeCount?: int32(name='ReservedNodeCount', description='The number of reserved resource nodes.', example='1'),
      reservedNodeSize?: string(name='ReservedNodeSize', description='The single-node specifications of reserved resources.', example='8ACU'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmyiu4ekp****'),
      storageResource?: string(name='StorageResource', description='The specifications of reserved storage resources. Each AnalyticDB compute unit (ACU) is approximately equal to 1 core and 4 GB memory. Storage resources are used to read and write data. The increase in the storage resources can improve the read and write performance of the cluster.', example='24ACU'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.

>  You can call the [TagResources](https://help.aliyun.com/document_detail/179253.html) operation to add tags to a cluster.', example='tag1'),
          value?: string(name='Value', description='The tag value.', example='test1'),
        }
      ](name='Tag')
      }(name='Tags', description='The tags that are added to the cluster.'),
      taskInfo?: {
        name?: string(name='Name', description='The name of the job.', example='analyticDBFlexibleScaleOut'),
        progress?: string(name='Progress', description='The progress of the job. Unit: %.', example='10'),
        status?: string(name='Status', description='The status of the job. Valid values:

*   **NOT_RUN**
*   **RUNNING**
*   **SUCCEED**', example='RUNNING'),
        stepList?: {
          stepList?: [ 
          {
            endTime?: string(name='EndTime', description='The end time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T10:28:34Z'),
            startTime?: string(name='StartTime', description='The start time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T09:28:34Z'),
            stepDesc?: string(name='StepDesc', description='The description of the job step.', example='Apply resource'),
            stepName?: string(name='StepName', description='The name of the job step.', example='ApplyResource'),
            stepProgress?: string(name='StepProgress', description='The progress of the job step. Unit: %.', example='50'),
            stepStatus?: string(name='StepStatus', description='The status of the job step. Valid values:

*   **NOT_RUN**
*   **RUNNING**
*   **SUCCEED**', example='SUCCEED'),
          }
        ](name='StepList')
        }(name='StepList', description='The job steps.'),
      }(name='TaskInfo', description='The job progress.'),
      VPCCloudInstanceId?: string(name='VPCCloudInstanceId', description='The ID of the cluster that resides in the VPC.', example='am-bp163885f8q21****-controller'),
      VPCId?: string(name='VPCId', description='The virtual private cloud (VPC) ID of the cluster.', example='vpc-bp13h7uzhulpuxvnp****'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.', example='vsw-bp1syh8vvw8yech7n****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the cluster.', example='cn-hangzhou-h'),
    }
  ](name='DBCluster')
  }(name='Items', description='The queried clusters.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='A5EDBA27-AF3E-5966-9503-FD1557E19167'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeDBClustersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClustersResponseBody(name='body'),
}

/**
 * @summary Queries the information about AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClustersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClustersResponse
 */
async function describeDBClustersWithOptions(request: DescribeDBClustersRequest, runtime: Util.RuntimeOptions): DescribeDBClustersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterDescription)) {
    query['DBClusterDescription'] = request.DBClusterDescription;
  }
  if (!Util.isUnset(request.DBClusterIds)) {
    query['DBClusterIds'] = request.DBClusterIds;
  }
  if (!Util.isUnset(request.DBClusterStatus)) {
    query['DBClusterStatus'] = request.DBClusterStatus;
  }
  if (!Util.isUnset(request.DBClusterVersion)) {
    query['DBClusterVersion'] = request.DBClusterVersion;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productVersion)) {
    query['ProductVersion'] = request.productVersion;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusters',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBClustersRequest
 * @return DescribeDBClustersResponse
 */
async function describeDBClusters(request: DescribeDBClustersRequest): DescribeDBClustersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClustersWithOptions(request, runtime);
}

model DescribeDBResourceGroupRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

> If you do not specify this parameter, the information about all resource groups in the cluster is returned.', example='test_group'),
  groupType?: string(name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

>  For more information about resource groups, see [Resource group overview](https://help.aliyun.com/document_detail/428610.html).', example='Job'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612393.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model DescribeDBResourceGroupResponseBody = {
  groupsInfo?: [ 
    {
      autoStopInterval?: string(name='AutoStopInterval'),
      clusterMode?: string(name='ClusterMode', description='A reserved parameter.', example='N/A'),
      clusterSizeResource?: string(name='ClusterSizeResource', description='A reserved parameter.', example='N/A'),
      createTime?: string(name='CreateTime', description='The time when the resource group was created. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2022-08-29T03:34:30Z'),
      elasticMinComputeResource?: string(name='ElasticMinComputeResource', description='The minimum amount of elastic computing resources.', example='16ACU'),
      enableSpot?: string(name='EnableSpot', description='Indicates whether the preemptible instance feature is enabled for the resource group. After the preemptible instance feature is enabled, you are charged for resources at a lower unit price but the resources are probably released. Valid values:

*   **True**
*   **False**

The True value is returned only for job resource groups.', example='True'),
      engine?: string(name='Engine'),
      engineParams?: map[string]any(name='EngineParams'),
      groupName?: string(name='GroupName', description='The name of the resource group.', example='test1'),
      groupType?: string(name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

>  For more information about resource groups, see [Resource groups](https://help.aliyun.com/document_detail/428610.html).', example='Job'),
      groupUsers?: string(name='GroupUsers', description='The Resource Access Management (RAM) user that is associated with the resource group.', example='testb,testc'),
      maxClusterCount?: int32(name='MaxClusterCount', description='A reserved parameter.', example='N/A'),
      maxComputeResource?: string(name='MaxComputeResource', description='The maximum amount of reserved computing resources.', example='512ACU'),
      maxGpuQuantity?: int32(name='MaxGpuQuantity'),
      message?: string(name='Message', description='This parameter is required.'),
      minClusterCount?: int32(name='MinClusterCount', description='A reserved parameter.', example='N/A'),
      minComputeResource?: string(name='MinComputeResource', description='The minimum amount of reserved computing resources.', example='0ACU'),
      minGpuQuantity?: int32(name='MinGpuQuantity'),
      rayConfig?: {
        category?: string(name='Category'),
        headSpec?: string(name='HeadSpec'),
        rayClusterAddress?: string(name='RayClusterAddress'),
        rayDashboardAddress?: string(name='RayDashboardAddress'),
        rayGrafanaAddress?: string(name='RayGrafanaAddress'),
        workerGroups?: [ 
          {
            allocateUnit?: string(name='AllocateUnit'),
            groupName?: string(name='GroupName'),
            maxWorkerQuantity?: int32(name='MaxWorkerQuantity'),
            minWorkerQuantity?: int32(name='MinWorkerQuantity'),
            workerDiskCapacity?: string(name='WorkerDiskCapacity'),
            workerSpecName?: string(name='WorkerSpecName'),
            workerSpecType?: string(name='WorkerSpecType'),
          }
        ](name='WorkerGroups'),
      }(name='RayConfig'),
      rules?: [ 
        {
          groupName?: string(name='GroupName', description='The name of the resource group.', example='user_default'),
          queryTime?: string(name='QueryTime', description='The execution duration of the query. Unit: milliseconds.', example='180000'),
          targetGroupName?: string(name='TargetGroupName', description='The name of the destination resource group.', example='job'),
        }
      ](name='Rules', description='The job resubmission rules.'),
      runningClusterCount?: int32(name='RunningClusterCount', description='A reserved parameter.', example='N/A'),
      specName?: string(name='SpecName'),
      status?: string(name='Status', description='The status of the resource group. Valid values:

*   **creating**: The resource group is being created.
*   **ok**: The resource group is created.
*   **pendingdelete**: The resource group is pending to be deleted.', example='ok'),
      targetResourceGroupName?: string(name='TargetResourceGroupName'),
      updateTime?: string(name='UpdateTime', description='The time when the resource group was updated. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2022-08-31T03:34:30Z'),
    }
  ](name='GroupsInfo', description='The queried resource groups.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A94B6C02-7BD4-5D67-9776-3AC8317E8DD3'),
}

model DescribeDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Queries the information about resource groups of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBResourceGroupResponse
 */
async function describeDBResourceGroupWithOptions(request: DescribeDBResourceGroupRequest, runtime: Util.RuntimeOptions): DescribeDBResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupType)) {
    query['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBResourceGroup',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about resource groups of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeDBResourceGroupRequest
 * @return DescribeDBResourceGroupResponse
 */
async function describeDBResourceGroup(request: DescribeDBResourceGroupRequest): DescribeDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBResourceGroupWithOptions(request, runtime);
}

model DescribeDiagnosisDimensionsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-bt6u59zcmd945****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.', example='1625220213000'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh-CN** (default): simplified Chinese.
*   **en-US**: English.
*   **ja**: Japanese.', example='zh-CN'),
  queryCondition?: string(name='QueryCondition', description='The query condition for SQL statements, which can contain the `Type`, `Value`, `Min`, and `Max` fields. Specify the condition in the JSON format. `Type` specifies the query dimension. Valid values for Type: `maxCost`, `status`, and `cost`. `Value`, `Min`, or `Max` specifies the query range for the dimension. Valid values:

*   `{"Type":"maxCost","Value":"100"}`: queries the top 100 most time-consuming SQL statements. Set `Value` to 100.
*   `{"Type":"status","Value":"finished"}`: queries the executed SQL statements. You can set `Value` to `running` to query the SQL statements that are being executed. You can also set Value to `failed` to query the SQL statements that failed to be executed.
*   `{"Type":"cost","Min":"10","Max":"200"}`: queries the SQL statements whose execution duration is in the range of 10 to 200 milliseconds. You can also specify custom values for the Min and Max fields.', example='{"Type":"maxCost","Value":"100"}'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

>  You can query data only within the last 14 days.', example='1625220210000'),
}

model DescribeDiagnosisDimensionsResponseBody = {
  clientIps?: [ string ](name='ClientIps', description='The queried source IP addresses.'),
  databases?: [ string ](name='Databases', description='The queried database names.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DEA97C6B-D7A4-5E69-9EFC-D7F88737CED5'),
  resourceGroups?: [ string ](name='ResourceGroups', description='The queried resource group names.'),
  userNames?: [ string ](name='UserNames', description='The queried usernames.'),
}

model DescribeDiagnosisDimensionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisDimensionsResponseBody(name='body'),
}

/**
 * @summary Queries the deduplicated statistics of resource groups, databases, usernames, and source IP addresses about SQL statements that meet a query condition for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDiagnosisDimensionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisDimensionsResponse
 */
async function describeDiagnosisDimensionsWithOptions(request: DescribeDiagnosisDimensionsRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisDimensionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.queryCondition)) {
    query['QueryCondition'] = request.queryCondition;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisDimensions',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the deduplicated statistics of resource groups, databases, usernames, and source IP addresses about SQL statements that meet a query condition for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDiagnosisDimensionsRequest
 * @return DescribeDiagnosisDimensionsResponse
 */
async function describeDiagnosisDimensions(request: DescribeDiagnosisDimensionsRequest): DescribeDiagnosisDimensionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisDimensionsWithOptions(request, runtime);
}

model DescribeDiagnosisRecordsRequest {
  clientIp?: string(name='ClientIp', description='The source IP address.

>  You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='59.82.XX.XX'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-bp1scs48yc125****'),
  database?: string(name='Database', description='The name of the database on which the SQL statements are executed.

>  You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.', example='1633017540000'),
  keyword?: string(name='Keyword', description='The query keyword of the SQL statements.', example='select'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  maxPeakMemory?: long(name='MaxPeakMemory', description='The maximum peak memory of the SQL statements. Unit: bytes.', example='89000000'),
  maxScanSize?: long(name='MaxScanSize', description='The maximum scan size of the SQL statements. Unit: bytes.', example='1024000000'),
  minPeakMemory?: long(name='MinPeakMemory', description='The minimum peak memory of the SQL statements. Unit: bytes.', example='0'),
  minScanSize?: long(name='MinScanSize', description='The minimum scan size of the SQL statements. Unit: bytes.', example='0'),
  order?: string(name='Order', description='The order in which to sort the SQL statements by field, which contains the `Field` and `Type` fields. Specify the order in the JSON format. Example: `[{"Field":"StartTime", "Type": "desc"}]`. Fields:

*   `Field` specifies the field that is used to sort the SQL statements. Valid values:

    *   `StartTime`: the execution start time.
    *   `Status`: the execution status.
    *   `UserName`: the username.
    *   `Cost`: the execution duration.
    *   `PeakMemory`: the peak memory.
    *   `ScanSize`: the amount of data that is scanned.
    *   `Database`: the name of the database.
    *   `ClientIp`: the source IP address.
    *   `ResourceGroup`: the name of the resource group.
    *   `QueueTime`: the amount of time that is consumed for queuing.
    *   `OutputRows`: the number of output rows.
    *   `OutputDataSize`: the amount of output data.
    *   `ResourceCostRank`: the execution duration rank of operators that are used in the SQL statements. This value takes effect only when `QueryCondition` is set to `{"Type":"status","Value":"running"}`.

*   `Type` specifies the sorting order. Valid values (case-insensitive):

    *   `Desc`: descending order.
    *   `Asc`: ascending order.', example='[{"Field":"StartTime", "Type": "desc" }]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  patternId?: string(name='PatternId', description='The SQL pattern ID.', example='5575924945138******'),
  queryCondition?: string(name='QueryCondition', description='The query condition for SQL statements, which can contain the `Type`, `Value`, `Min`, and `Max` fields. Specify the condition in the JSON format. `Type` specifies the query dimension. Valid values for Type: `maxCost`, `status`, and `cost`. `Value`, `Min`, or `Max` specifies the query range for the dimension. Valid values:

*   `{"Type":"maxCost","Value":"100"}`: queries the top 100 most time-consuming SQL statements. Set `Value` to 100.
*   `{"Type":"status","Value":"finished"}`: queries the executed SQL statements. You can set `Value` to `running` to query the SQL statements that are being executed. You can also set Value to `failed` to query the SQL statements that failed to be executed.
*   `{"Type":"cost","Min":"10","Max":"200"}`: queries the SQL statements whose execution duration is in the range of 10 to 200 milliseconds. You can also specify custom values for the Min and Max fields.', example='{"Type":"status","Value":"finished"}'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The resource group to which the SQL statements belong.

>  You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='user_default'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

>  You can query data only within the last 14 days.', example='1632931200000'),
  userName?: string(name='UserName', description='The username that is used to execute the SQL statements. You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='test_user'),
}

model DescribeDiagnosisRecordsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  querys?: [ 
    {
      clientIp?: string(name='ClientIp', description='The source IP address.', example='59.82.XX.XX'),
      cost?: long(name='Cost', description='The total execution duration. Unit: milliseconds.

>  This value is the cumulative value of the `QueuedTime`, `TotalPlanningTime`, and `ExecutionTime` parameters.', example='10'),
      database?: string(name='Database', description='The name of the database on which the SQL statement is executed.', example='adb_demo'),
      etlWriteRows?: long(name='EtlWriteRows', description='The number of rows written to the table by an extract-transform-load (ETL) job.', example='0'),
      executionTime?: long(name='ExecutionTime', description='The execution duration. Unit: milliseconds.', example='6'),
      outputDataSize?: long(name='OutputDataSize', description='The amount of returned data. Unit: bytes.', example='9'),
      outputRows?: long(name='OutputRows', description='The number of rows returned.', example='1'),
      patternId?: string(name='PatternId'),
      peakMemory?: long(name='PeakMemory', description='The peak memory. Unit: bytes.', example='16648'),
      processId?: string(name='ProcessId', description='The query ID.', example='2021093000414401000000023503151******'),
      queryProperties?: [ 
        {
          name?: string(name='Name'),
          value?: string(name='Value'),
        }
      ](name='QueryProperties'),
      queueTime?: long(name='QueueTime', description='The amount of time that is consumed for queuing. Unit: milliseconds.', example='6'),
      rcHost?: string(name='RcHost', description='The IP address and port number of the AnalyticDB for MySQL frontend node on which the SQL statement is executed.', example='10.0.XX.XX:3004'),
      resourceCostRank?: int32(name='ResourceCostRank', description='The execution duration rank of operators that are used in the SQL statement.

>  This parameter is returned only for SQL statements whose `Status` parameter is `running`.', example='1'),
      resourceGroup?: string(name='ResourceGroup', description='The resource group to which the SQL statement belongs.', example='user_default'),
      SQL?: string(name='SQL', description='The queried SQL statement.

>  For performance considerations, an SQL statement cannot exceed 5,120 characters in length. Otherwise, the SQL statement is truncated. You can call the [DownloadDiagnosisRecords](https://help.aliyun.com/document_detail/308212.html) operation to download the information about SQL statements that meet a query condition for an AnalyticDB for MySQL cluster, including the complete SQL statements.', example='SELECT count(*)\\\\nFROM nation'),
      SQLTruncated?: boolean(name='SQLTruncated', description='Indicates whether the SQL statement is truncated. Valid values:

*   **true**
*   **false**', example='false'),
      SQLTruncatedThreshold?: long(name='SQLTruncatedThreshold', description='The maximum length of the SQL statement. 5120 is returned. Unit: characters. SQL statements that exceed this limit are truncated.', example='5120'),
      scanRows?: long(name='ScanRows', description='The number of rows scanned.', example='1'),
      scanSize?: long(name='ScanSize', description='The amount of scanned data. Unit: bytes.', example='9'),
      startTime?: long(name='StartTime', description='The execution start time of the SQL statement. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1632933704000'),
      status?: string(name='Status', description='The state of the SQL statement. Valid values:

*   **running**
*   **finished**
*   **failed**', example='finished'),
      totalPlanningTime?: long(name='TotalPlanningTime', description='The amount of time that is consumed to generate an execution plan. Unit: milliseconds.', example='4'),
      totalStages?: int32(name='TotalStages', description='The total number of stages generated.', example='2'),
      userName?: string(name='UserName', description='The username that is used to execute the SQL statements.', example='test_user'),
    }
  ](name='Querys', description='The queried SQL statements.'),
  requestId?: string(name='RequestId', description='The request ID.', example='7F88BEFA-CF0B-5C95-8BB1-92EC9F09E40D'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeDiagnosisRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic information about SQL statements that meet a query condition for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDiagnosisRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisRecordsResponse
 */
async function describeDiagnosisRecordsWithOptions(request: DescribeDiagnosisRecordsRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientIp)) {
    query['ClientIp'] = request.clientIp;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.database)) {
    query['Database'] = request.database;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.maxPeakMemory)) {
    query['MaxPeakMemory'] = request.maxPeakMemory;
  }
  if (!Util.isUnset(request.maxScanSize)) {
    query['MaxScanSize'] = request.maxScanSize;
  }
  if (!Util.isUnset(request.minPeakMemory)) {
    query['MinPeakMemory'] = request.minPeakMemory;
  }
  if (!Util.isUnset(request.minScanSize)) {
    query['MinScanSize'] = request.minScanSize;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.patternId)) {
    query['PatternId'] = request.patternId;
  }
  if (!Util.isUnset(request.queryCondition)) {
    query['QueryCondition'] = request.queryCondition;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    query['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisRecords',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic information about SQL statements that meet a query condition for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDiagnosisRecordsRequest
 * @return DescribeDiagnosisRecordsResponse
 */
async function describeDiagnosisRecords(request: DescribeDiagnosisRecordsRequest): DescribeDiagnosisRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisRecordsWithOptions(request, runtime);
}

model DescribeDiagnosisSQLInfoRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-bp1r053byu48p'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  processId?: string(name='ProcessId', description='The query ID.

>  You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL cluster, including the query ID.', example='2021070216432217201616806503453'),
  processRcHost?: string(name='ProcessRcHost', description='The IP address and port number of the AnalyticDB for MySQL frontend node on which the SQL statement is executed.

>  You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster, including the IP address and port number of the frontend node.', example='192.45.***.***:3145'),
  processStartTime?: long(name='ProcessStartTime', description='The execution start time of the SQL statement. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

>  You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL cluster, including the execution start time of the SQL statement.', example='1625215402000'),
  processState?: string(name='ProcessState', description='The status of the SQL statement. Valid values:

*   **running**
*   **finished**
*   **failed**

>  You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL cluster, including the status of the SQL statement.', example='running'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDiagnosisSQLInfoResponseBody = {
  diagnosisSQLInfo?: string(name='DiagnosisSQLInfo', description='The queried execution information, including the SQL statement, statistics, execution plan, and operator information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1'),
  stageInfos?: [ 
    {
      executionType?: string(name='ExecutionType'),
      inputDataSize?: long(name='InputDataSize', description='The total amount of input data in the stage. Unit: bytes.', example='2341'),
      inputRows?: long(name='InputRows', description='The total number of input rows in the stage.', example='2341'),
      operatorCost?: long(name='OperatorCost', description='The total amount of time consumed by all operators in the stage. Unit: milliseconds.', example='2341'),
      outputDataSize?: long(name='OutputDataSize', description='The total amount of output data in the stage. Unit: bytes.', example='2341'),
      outputRows?: long(name='OutputRows', description='The total number of output rows in the stage.', example='2341'),
      peakMemory?: long(name='PeakMemory', description='The total peak memory of the stage. Unit: bytes.', example='2341'),
      progress?: double(name='Progress', description='The execution progress of the stage.', example='0.3'),
      stageId?: string(name='StageId', description='The stage ID.', example='Stage[26]'),
      state?: string(name='State', description='The state of the stage.', example='RUNNING'),
    }
  ](name='StageInfos', description='The queried execution information by stage.'),
}

model DescribeDiagnosisSQLInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisSQLInfoResponseBody(name='body'),
}

/**
 * @summary Queries the execution information about an SQL statement, including the execution plan, execution information, resource usage, and self-diagnostics results.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDiagnosisSQLInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisSQLInfoResponse
 */
async function describeDiagnosisSQLInfoWithOptions(request: DescribeDiagnosisSQLInfoRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisSQLInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.processId)) {
    query['ProcessId'] = request.processId;
  }
  if (!Util.isUnset(request.processRcHost)) {
    query['ProcessRcHost'] = request.processRcHost;
  }
  if (!Util.isUnset(request.processStartTime)) {
    query['ProcessStartTime'] = request.processStartTime;
  }
  if (!Util.isUnset(request.processState)) {
    query['ProcessState'] = request.processState;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisSQLInfo',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution information about an SQL statement, including the execution plan, execution information, resource usage, and self-diagnostics results.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDiagnosisSQLInfoRequest
 * @return DescribeDiagnosisSQLInfoResponse
 */
async function describeDiagnosisSQLInfo(request: DescribeDiagnosisSQLInfoRequest): DescribeDiagnosisSQLInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisSQLInfoWithOptions(request, runtime);
}

model DescribeDownloadRecordsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-8vb6ha79k6e****'),
  lang?: string(name='Lang', description='The language of the returned data. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDownloadRecordsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  records?: [ 
    {
      downloadId?: long(name='DownloadId', description='The download job ID.', example='636890'),
      exceptionMsg?: string(name='ExceptionMsg', description='The error message returned if the download job failed.', example='The query result is empty.'),
      fileName?: string(name='FileName', description='The name of the downloaded file.', example='20210806094635-20210806095135'),
      status?: string(name='Status', description='The status of the download job. Valid values:

*   **running**
*   **finished**
*   **failed**', example='finished'),
      url?: string(name='Url', description='The download URL of the file.'),
    }
  ](name='Records', description='The queried download tasks.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D761DA51-12F8-5457-AAA9-F52B9F436D2D'),
}

model DescribeDownloadRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDownloadRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the last five SQL query download tasks of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDownloadRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDownloadRecordsResponse
 */
async function describeDownloadRecordsWithOptions(request: DescribeDownloadRecordsRequest, runtime: Util.RuntimeOptions): DescribeDownloadRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDownloadRecords',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the last five SQL query download tasks of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeDownloadRecordsRequest
 * @return DescribeDownloadRecordsResponse
 */
async function describeDownloadRecords(request: DescribeDownloadRecordsRequest): DescribeDownloadRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDownloadRecordsWithOptions(request, runtime);
}

model DescribeElasticPlanAttributeRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

>  You can call the [DescribeElasticPlans](https://help.aliyun.com/document_detail/601334.html) operation to query the names of scaling plans.

This parameter is required.', example='test'),
}

model DescribeElasticPlanAttributeResponseBody = {
  elasticPlan?: {
    autoScale?: boolean(name='AutoScale', description='Indicates whether **Default Proportional Scaling for EIUs** is enabled. Valid values: true: Default Proportional Scaling for EIUs is enabled. If you set this parameter to true, storage resources are scaled along with computing resources. false: Default Proportional Scaling for EIUs is not enabled.

>  You can enable Default Proportional Scaling for EIUs for only a single scaling plan of a cluster. After you enable a scaling plan of the Default Proportional Scaling for EIUs type, you cannot enable scaling plans of other types.', example='false'),
    cronExpression?: string(name='CronExpression', description='A CORN expression that indicates the scaling cycle and time for the scaling plan.', example='0 20 14 * * ?'),
    elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.', example='test'),
    enabled?: boolean(name='Enabled', description='Indicates whether the scaling plan is enabled.', example='true'),
    endTime?: string(name='EndTime', description='The end time of the scaling plan.

>  The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2025-01-01T12:01:00Z'),
    resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group used by the scaling plan.', example='test'),
    startTime?: string(name='StartTime', description='The start time of the scaling plan.

>  The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2022-01-01T12:01:00Z'),
    targetSize?: string(name='TargetSize', description='The amount of elastic resources after scaling.', example='32ACU'),
    type?: string(name='Type', description='The type of the scaling plan.', example='EXECUTOR'),
  }(name='ElasticPlan', description='The queried scaling plan.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
}

model DescribeElasticPlanAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticPlanAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the information about a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeElasticPlanAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticPlanAttributeResponse
 */
async function describeElasticPlanAttributeWithOptions(request: DescribeElasticPlanAttributeRequest, runtime: Util.RuntimeOptions): DescribeElasticPlanAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticPlanAttribute',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeElasticPlanAttributeRequest
 * @return DescribeElasticPlanAttributeResponse
 */
async function describeElasticPlanAttribute(request: DescribeElasticPlanAttributeRequest): DescribeElasticPlanAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticPlanAttributeWithOptions(request, runtime);
}

model DescribeElasticPlanJobsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

> 

*   If you do not specify this parameter, all scaling plans of the cluster are queried.

*   You can call the [DescribeElasticPlans](https://help.aliyun.com/document_detail/601334.html) operation to query the names of scaling plans.', example='test'),
  pageNumber?: int32(name='PageNumber', description='The page number.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

This parameter is required.', example='10'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

> 

*   If you do not specify this parameter, the scaling plans of all resource groups are queried, including the interactive resource group and elastic I/O unit (EIU) types.

*   You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the resource group name for a cluster.', example='test'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-01-01T12:01:00Z'),
  status?: string(name='Status', description='The state of the scaling plan job. Valid values:

*   RUNNING
*   SUCCESSFUL
*   FAILED

>  If you do not specify this parameter, the scaling plans in all states are queried.', example='SUCCESSFUL'),
}

model DescribeElasticPlanJobsResponseBody = {
  jobs?: [ 
    {
      elasticAcu?: string(name='ElasticAcu', description='The amount of elastic resources.

> 

*   If Type is set to EXECUTOR, ElasticAcu indicates the amount of elastic resources in the current resource group.

*   If Type is set to WORKER, ElasticAcu indicates the total amount of elastic storage resources in the current cluster.', example='16ACU'),
      elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.', example='test'),
      endTime?: string(name='EndTime', description='The end time of the scaling plan job.

>  The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.', example='2022-01-01T12:01:00Z'),
      instanceSize?: int32(name='InstanceSize', description='The number of compute nodes or storage replica sets.

> 

*   If Type is set to EXECUTOR, InstanceSize indicates the number of compute nodes in the cluster.

*   If Type is set to EXECUTOR, InstanceSize indicates the number of storage replica sets in the cluster.', example='1'),
      reserveAcu?: string(name='ReserveAcu', description='The amount of reserved resources.

> 

*   If Type is set to EXECUTOR, ReserveAcu indicates the amount of reserved resources in the current resource group.

*   If Type is set to WORKER, ReserveAcu indicates the total amount of reserved storage resources in the current cluster.', example='16ACU'),
      resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.', example='test'),
      startTime?: string(name='StartTime', description='The start time of the scaling plan job.

>  The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.', example='2022-01-01T11:01:00Z'),
      status?: string(name='Status', description='The state of the scaling plan job. Valid values:

*   RUNNING
*   SUCCESSFUL
*   FAILED', example='SUCCESSFUL'),
      targetSize?: string(name='TargetSize', description='The desired specifications of elastic resources after scaling.', example='32ACU'),
      totalAcu?: string(name='TotalAcu', description='The total amount of resources.

> 

*   If Type is set to EXECUTOR, TotalAcu indicates the total amount of computing resources in the current resource group.

*   If Type is set to WORKER, TotalAcu indicates the total amount of storage resources in the cluster.', example='32ACU'),
      type?: string(name='Type', description='The type of the scaling plan job. Valid values:

*   EXECUTOR: the interactive resource group type, which indicates the computing resource type.
*   WORKER: the EIU type.', example='EXECUTOR'),
    }
  ](name='Jobs', description='The queried scaling plan jobs.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
  totalCount?: int32(name='TotalCount', description='The total number of scaling plan jobs.', example='15'),
}

model DescribeElasticPlanJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticPlanJobsResponseBody(name='body'),
}

/**
 * @summary Queries a list of scaling plan jobs for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeElasticPlanJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticPlanJobsResponse
 */
async function describeElasticPlanJobsWithOptions(request: DescribeElasticPlanJobsRequest, runtime: Util.RuntimeOptions): DescribeElasticPlanJobsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticPlanJobs',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of scaling plan jobs for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeElasticPlanJobsRequest
 * @return DescribeElasticPlanJobsResponse
 */
async function describeElasticPlanJobs(request: DescribeElasticPlanJobsRequest): DescribeElasticPlanJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticPlanJobsWithOptions(request, runtime);
}

model DescribeElasticPlanSpecificationsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

> 

*   This parameter must be specified only when you query the resource specifications that are supported by an interactive resource group.

*   You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the name of a resource group within a cluster.', example='test'),
  type?: string(name='Type', description='The type of the scaling plan. Valid values:

*   EXECUTOR: the interactive resource group type, which specifies the computing resource type.
*   WORKER: the elastic I/O unit (EIU) type.

This parameter is required.', example='EXECUTOR'),
}

model DescribeElasticPlanSpecificationsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='5'),
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
  specifications?: [ string ](name='Specifications', description='The queried resource specifications.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeElasticPlanSpecificationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticPlanSpecificationsResponseBody(name='body'),
}

/**
 * @summary Queries the resource specifications that are supported by different types of scaling plans of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeElasticPlanSpecificationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticPlanSpecificationsResponse
 */
async function describeElasticPlanSpecificationsWithOptions(request: DescribeElasticPlanSpecificationsRequest, runtime: Util.RuntimeOptions): DescribeElasticPlanSpecificationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticPlanSpecifications',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resource specifications that are supported by different types of scaling plans of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeElasticPlanSpecificationsRequest
 * @return DescribeElasticPlanSpecificationsResponse
 */
async function describeElasticPlanSpecifications(request: DescribeElasticPlanSpecificationsRequest): DescribeElasticPlanSpecificationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticPlanSpecificationsWithOptions(request, runtime);
}

model DescribeElasticPlansRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

> If you do not specify this parameter, all scaling plans are queried.', example='test'),
  enabled?: boolean(name='Enabled', description='Specifies whether to query the scaling plans that are immediately enabled after the plans are created. Valid values:

*   **true**
*   **false**', example='true'),
  pageNumber?: int32(name='PageNumber', description='The page number.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

This parameter is required.', example='10'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

> *   If you do not specify this parameter, the scaling plans of all resource groups are queried, covering the interactive resource group type and the elastic I/O unit (EIU) type.
>*   You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the name of a resource group within a cluster.', example='test'),
  type?: string(name='Type', description='The type of the scaling plan. Valid values:

*   **EXECUTOR**: the interactive resource group type, which specifies the computing resource type.
*   **WORKER**: the EIU type.', example='EXECUTOR'),
}

model DescribeElasticPlansResponseBody = {
  elasticPlans?: [ 
    {
      autoScale?: boolean(name='AutoScale', description='Indicates whether **Proportional Default Scaling for EIUs** is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.', example='test'),
      enabled?: boolean(name='Enabled', description='Indicates whether the scaling plan is immediately enabled after the plan is created. Valid values:

*   **true**
*   **false**', example='true'),
      nextScheduleTime?: string(name='NextScheduleTime', description='The time when the next scheduling is performed.

> The time is in the yyyy-MM-ddTHH:mm:ssZ format.', example='2022-01-01T12:01:00Z'),
      resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

> You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the name of a resource group within a cluster.', example='test'),
      targetSize?: string(name='TargetSize', description='The amount of elastic resources after scaling.', example='32ACU'),
      type?: string(name='Type', description='The type of the scaling plan. Valid values:

*   **EXECUTOR**: the interactive resource group type, which specifies the computing resource type.
*   **WORKER**: the EIU type.', example='EXECUTOR'),
    }
  ](name='ElasticPlans', description='The queried scaling plans.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='15'),
}

model DescribeElasticPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticPlansResponseBody(name='body'),
}

/**
 * @summary Queries scaling plans of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeElasticPlansRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticPlansResponse
 */
async function describeElasticPlansWithOptions(request: DescribeElasticPlansRequest, runtime: Util.RuntimeOptions): DescribeElasticPlansResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticPlans',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries scaling plans of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeElasticPlansRequest
 * @return DescribeElasticPlansResponse
 */
async function describeElasticPlans(request: DescribeElasticPlansRequest): DescribeElasticPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticPlansWithOptions(request, runtime);
}

model DescribeEnabledPrivilegesRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

>  You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/612430.html) operation to query the information about database accounts for a cluster, including the account name.', example='test_accout'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp14t95lun0w****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeEnabledPrivilegesResponseBody = {
  data?: [ 
    {
      description?: string(name='Description', description='The description of the permission level.

This parameter is required.'),
      privileges?: [ 
        {
          description?: string(name='Description', description='The description of the permission.'),
          key?: string(name='Key', description='The name of the permission.', example='select'),
        }
      ](name='Privileges', description='The queried permissions.

This parameter is required.'),
      scope?: string(name='Scope', description='The permission level.

This parameter is required.', example='Global'),
    }
  ](name='Data', description='The queried permission level and permissions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='246F42E0-A475-15FF-96D2-8DC47FC2F289'),
}

model DescribeEnabledPrivilegesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEnabledPrivilegesResponseBody(name='body'),
}

/**
 * @summary Queries the permission level and permissions supported for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @param request DescribeEnabledPrivilegesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEnabledPrivilegesResponse
 */
async function describeEnabledPrivilegesWithOptions(request: DescribeEnabledPrivilegesRequest, runtime: Util.RuntimeOptions): DescribeEnabledPrivilegesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEnabledPrivileges',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the permission level and permissions supported for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @param request DescribeEnabledPrivilegesRequest
 * @return DescribeEnabledPrivilegesResponse
 */
async function describeEnabledPrivileges(request: DescribeEnabledPrivilegesRequest): DescribeEnabledPrivilegesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEnabledPrivilegesWithOptions(request, runtime);
}

model DescribeEssdCacheConfigRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-uf685u1o987hj6rn'),
}

model DescribeEssdCacheConfigResponseBody = {
  data?: {
    enableEssdCache?: boolean(name='EnableEssdCache', description='Specifies whether to enable the disk cache feature.

Valid values:

*   true
*   false', example='true'),
    essdCacheSize?: int32(name='EssdCacheSize', description='The disk cache size. Unit: GB.', example='500'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7EDB8E4-9769-4233-88C7-DCA4C9******'),
}

model DescribeEssdCacheConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEssdCacheConfigResponseBody(name='body'),
}

/**
 * @summary Queries the disk cache size in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeEssdCacheConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEssdCacheConfigResponse
 */
async function describeEssdCacheConfigWithOptions(request: DescribeEssdCacheConfigRequest, runtime: Util.RuntimeOptions): DescribeEssdCacheConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEssdCacheConfig',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the disk cache size in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeEssdCacheConfigRequest
 * @return DescribeEssdCacheConfigResponse
 */
async function describeEssdCacheConfig(request: DescribeEssdCacheConfigRequest): DescribeEssdCacheConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEssdCacheConfigWithOptions(request, runtime);
}

model DescribeExcessivePrimaryKeysRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.', example='2019-06-01T16:00:00Z'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh (default)**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order in which table fields are sorted. Specify the value in the JSON format.

Example:

    [

        {

            "Field":"Name",

            "Type":"Asc"

        }

    ]

In the preceding code, Field specifies the field that is used to sort the table data. Set the value to Name. Type specifies the sorting order. Valid values: Desc and Asc.

Field and Type are case-insensitive.', example='[{"Field":"TableName", "Type": "Desc" }]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.', example='2019-06-01T16:00:00Z'),
}

model DescribeExcessivePrimaryKeysResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The queried information about the request denial.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1906102576997697",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcNqPqHV6lwR4INiAGjIvK1ngXxN1O+6ORRB6A8YvztEOGywOk81ZmuNk0YrNy+qk7+UVDTHeXKsy8h9e/ePY/LMidj0RCmDpo/YpCumd0UGe0qEPe2U+UJAm/+UHlnEFLVg6BP3yIB5D++MCy7mgWm8Kwyhk62IeYly4hQ+5IpXjkh1GQXuDgLVVPVpxEek9n30vnCUL4KsaMgfa7dgojb+3TM8xGsD2zVK5STJNrsXclscIJEqyNXd7CBYiRJVZi1HPO6drN9WW0chLpCSTgjO8n0bNanZaxXKumW9PSwV58UoSFASeMWfZK3TLngX+oq8nGmnTwcJosVjfF4RGzAnS1IXt0Q9N2WHDnpwyLBU/nOz7Hsy8IZ+h+OVjsBTXSM9688/vOF707a5mNzpETvQeGRcua3A5livcKAM2cML0yeUs/Zyj/+BGqtVa+wektspDHC/CECh6R5lxQjRmUdPawY8VDs2onmdLuEH8DdmYt+Yv/jBFBUMWOyAluzkPYcX5nuQKouCIUJUFTSbsJsuH5CTIh7Ls5rbmkj+T1qTVz8gnDR8LxwaqoMSna+elXgVyOOxXtMkenVntsmoC3p/4G7yTPL1hu8JyWGIIvZHZGGLXGEH7FeSuMV8buKxPGFWG3arG8e9LGvDdz5dgTien4y6G5AQ0o1iQdXDos5VWdH3u7k5PrsvdEOpvMi6uSd8a42na80FsYlgGlwM5upydcWUC5Un2HCkJpT1xgk2L6shdVTrK6bidRrqE784FhW9bBQePzGaxSupPENZya0VUctRt+7uq3QwIn4y5jzjgX0E0jgmqPrgiVDjBesMQZYfGPCGysWYWYzfoh+G6V7N2VVGtNnGUwNWzM0WJBPONAgxPv+AmixFRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "202515810214480629",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
  }'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1ub9grke1****'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The detection result.', example='OK'),
      name?: string(name='Name', description='The name of the detection item.', example='test'),
      status?: string(name='Status', description='The severity level of the detection result.', example='NORMAL
WARNNING
CRITICAL'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='863D51B7-5321-41D8-A0B6-A088B0******'),
  tables?: [ 
    {
      columnCount?: int32(name='ColumnCount', description='The total number of columns.', example='21'),
      primaryKeyColumns?: string(name='PrimaryKeyColumns', description='The queried primary key fields.', example='2'),
      primaryKeyCount?: int32(name='PrimaryKeyCount', description='The number of primary key fields.', example='3'),
      primaryKeyIndexSize?: long(name='PrimaryKeyIndexSize', description='The data size of primary key indexes. Unit: bytes.', example='222'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      spaceRatio?: double(name='SpaceRatio', description='The percentage of the table size. Unit: %.

>  Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.', example='23'),
      tableName?: string(name='TableName', description='The name of the table', example='test'),
      totalSize?: long(name='TotalSize', description='The cold data size. Unit: bytes.

>  Formula: Cold data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Data size of other data.', example='4'),
    }
  ](name='Tables', description='The queried tables that have excessive primary key fields.'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='300'),
}

model DescribeExcessivePrimaryKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeExcessivePrimaryKeysResponseBody(name='body'),
}

/**
 * @summary Queries the information about tables that have excessive primary key fields in an AnalyticDB for MySQL Data Lakehouse Edition (V5.0) cluster.
 *
 * @param request DescribeExcessivePrimaryKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeExcessivePrimaryKeysResponse
 */
async function describeExcessivePrimaryKeysWithOptions(request: DescribeExcessivePrimaryKeysRequest, runtime: Util.RuntimeOptions): DescribeExcessivePrimaryKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeExcessivePrimaryKeys',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about tables that have excessive primary key fields in an AnalyticDB for MySQL Data Lakehouse Edition (V5.0) cluster.
 *
 * @param request DescribeExcessivePrimaryKeysRequest
 * @return DescribeExcessivePrimaryKeysResponse
 */
async function describeExcessivePrimaryKeys(request: DescribeExcessivePrimaryKeysRequest): DescribeExcessivePrimaryKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeExcessivePrimaryKeysWithOptions(request, runtime);
}

model DescribeExecutorDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-xxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

This parameter is required.', example='2021-05-27T16:00Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-shenzhen'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

This parameter is required.', example='2024-10-31T02:06Z'),
}

model DescribeExecutorDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.', example='am-xxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='Large amounts of memory resources are used by the Aggregation operator.'),
      name?: string(name='Name', description='The name of the detection item.', example='Metric detection'),
      results?: {
        operatorAgg?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='OperatorCost'),
            searchResults?: [ 
              {
                avgValue?: double(name='AvgValue', description='The average value of the operator metric.', example='234'),
                maxValue?: long(name='MaxValue', description='The maximum value of the operator metric.', example='2345'),
                operatorCount?: long(name='OperatorCount', description='The number of occurrences of the operator.', example='3'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='Window'),
                totalValue?: long(name='TotalValue', description='The cumulative value of the operator metric.', example='345'),
              }
            ](name='SearchResults', description='The detection result items of operator metric aggregation.'),
          }
        ](name='OperatorAgg', description='The detection result items of operator metric aggregation.'),
        operatorDetails?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='PeakMemory'),
            searchResults?: [ 
              {
                inputRows?: long(name='InputRows', description='The number of rows input by the operator.', example='123'),
                inputSize?: long(name='InputSize', description='The amount of data input by the operator. Unit: bytes.', example='345'),
                operatorCost?: double(name='OperatorCost', description='The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.', example='123'),
                operatorInfo?: string(name='OperatorInfo', description='The property information about the operator.', example='GROUP BY field: uid'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='Join'),
                outputRows?: long(name='OutputRows', description='The number of rows output by the operator.', example='2345'),
                outputSize?: long(name='OutputSize', description='The amount of data output by the operator. Unit: bytes.', example='234'),
                peakMemory?: long(name='PeakMemory', description='The peak memory. Unit: bytes.', example='234'),
                processId?: string(name='ProcessId', description='The query ID.', example='2024080110010002102500023803151627972'),
                stageId?: string(name='StageId', description='The stage ID.', example='Stage[3]'),
              }
            ](name='SearchResults', description='The detection result items of abnormal operators.'),
          }
        ](name='OperatorDetails', description='The detection result items of abnormal operators.'),
      }(name='Results', description='The detection result items.'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9DFF5F54-162B-5860-80A5-411FF550B347'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='566'),
}

model DescribeExecutorDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeExecutorDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic results of the compute layer.
 *
 * @param request DescribeExecutorDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeExecutorDetectionResponse
 */
async function describeExecutorDetectionWithOptions(request: DescribeExecutorDetectionRequest, runtime: Util.RuntimeOptions): DescribeExecutorDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeExecutorDetection',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic results of the compute layer.
 *
 * @param request DescribeExecutorDetectionRequest
 * @return DescribeExecutorDetectionResponse
 */
async function describeExecutorDetection(request: DescribeExecutorDetectionRequest): DescribeExecutorDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeExecutorDetectionWithOptions(request, runtime);
}

model DescribeInclinedNodesRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-wz9jd******d1765'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeInclinedNodesResponseBody = {
  items?: [ 
    {
      diskUsageRatio?: string(name='DiskUsageRatio', description='The disk usage of the storage node.', example='90.5'),
      node?: string(name='Node', description='The number of the storage node.', example='Node1'),
    }
  ](name='Items', description='The queried storage nodes.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C0BF6685-0519-543E-90F8-DB8949E4D5F2'),
}

model DescribeInclinedNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInclinedNodesResponseBody(name='body'),
}

/**
 * @summary Queries the disk usage of all storage nodes.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeInclinedNodesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInclinedNodesResponse
 */
async function describeInclinedNodesWithOptions(request: DescribeInclinedNodesRequest, runtime: Util.RuntimeOptions): DescribeInclinedNodesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInclinedNodes',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the disk usage of all storage nodes.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeInclinedNodesRequest
 * @return DescribeInclinedNodesResponse
 */
async function describeInclinedNodes(request: DescribeInclinedNodesRequest): DescribeInclinedNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInclinedNodesWithOptions(request, runtime);
}

model DescribeInclinedTablesRequest {
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='amv-k2jofo4pi5zhd****'),
  lang?: string(name='Lang', example='zh'),
  order?: string(name='Order', example='[      {          "Field":"Name",          "Type":"Asc"      }  ]'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  regionId?: string(name='RegionId', example='cn-hongkong'),
  tableType?: string(name='TableType', example='FactTable'),
}

model DescribeInclinedTablesResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  detectionItems?: [ 
    {
      message?: string(name='Message'),
      name?: string(name='Name'),
      status?: string(name='Status', example='NORMAL
WARNNING
CRITICAL'),
    }
  ](name='DetectionItems'),
  items?: {
    table?: [ 
      {
        isIncline?: boolean(name='IsIncline', example='True'),
        name?: string(name='Name', example='admin_daily_own_statistic_record'),
        rowCount?: long(name='RowCount', example='1000'),
        schema?: string(name='Schema', example='spark_test'),
        size?: long(name='Size', example='200'),
        spaceRatio?: double(name='SpaceRatio', example='0.4'),
        totalSize?: long(name='TotalSize', example='53687091200'),
        type?: string(name='Type', example='Fact'),
      }
    ](name='Table'),
  }(name='Items'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='30'),
  requestId?: string(name='RequestId', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalCount?: string(name='TotalCount', example='15'),
}

model DescribeInclinedTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInclinedTablesResponseBody(name='body'),
}

/**
 * @summary 查看表倾斜诊断结果
 *
 * @param request DescribeInclinedTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInclinedTablesResponse
 */
async function describeInclinedTablesWithOptions(request: DescribeInclinedTablesRequest, runtime: Util.RuntimeOptions): DescribeInclinedTablesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tableType)) {
    query['TableType'] = request.tableType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInclinedTables',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看表倾斜诊断结果
 *
 * @param request DescribeInclinedTablesRequest
 * @return DescribeInclinedTablesResponse
 */
async function describeInclinedTables(request: DescribeInclinedTablesRequest): DescribeInclinedTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInclinedTablesWithOptions(request, runtime);
}

model DescribeJobResourceUsageRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The end time must be later than the start time.

This parameter is required.', example='2023-03-17T16:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

This parameter is required.', example='2023-02-04T03:45:00Z'),
}

model DescribeJobResourceUsageResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-clusterxxx'),
    endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-05-23T16:00:00Z'),
    jobAcuUsage?: [ 
      {
        acuUsageDetail?: {
          elasticAcuNumber?: float(name='ElasticAcuNumber', description='The number of ACUs for the elastic resources.', example='16ACU'),
          reservedAcuNumber?: float(name='ReservedAcuNumber', description='The number of ACUs for the reserved resources.', example='16ACU'),
          spotAcuNumber?: float(name='SpotAcuNumber', description='The number of spot ACUs.', example='16ACU'),
          spotAcuPercentage?: float(name='SpotAcuPercentage', description='The percent of spot ACUs.', example='0.9'),
          totalAcuNumber?: float(name='TotalAcuNumber', description='The total number of ACUs.', example='32ACU'),
        }(name='AcuUsageDetail', description='The ACU usage.'),
        jobEndTime?: string(name='JobEndTime', description='The end time of the job. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-05-23T16:00:00Z'),
        jobId?: string(name='JobId', description='The job ID.', example='1592'),
        jobStartTime?: string(name='JobStartTime', description='The start time of the job. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-05-22T16:00:00Z'),
        resourceGroupName?: string(name='ResourceGroupName', description='The name of the job resource group.', example='job_default'),
      }
    ](name='JobAcuUsage', description='The AnalyticDB compute unit (ACU) usage of the job resource group.'),
    startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-05-22T16:00:00Z'),
  }(name='Data', description='The queried resource usage.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeJobResourceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeJobResourceUsageResponseBody(name='body'),
}

/**
 * @summary 获取作业资源使用统计
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeJobResourceUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeJobResourceUsageResponse
 */
async function describeJobResourceUsageWithOptions(request: DescribeJobResourceUsageRequest, runtime: Util.RuntimeOptions): DescribeJobResourceUsageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeJobResourceUsage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取作业资源使用统计
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeJobResourceUsageRequest
 * @return DescribeJobResourceUsageResponse
 */
async function describeJobResourceUsage(request: DescribeJobResourceUsageRequest): DescribeJobResourceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeJobResourceUsageWithOptions(request, runtime);
}

model DescribeKernelVersionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> 

*   You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/98094.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-2ze918p6qf6h9****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-shenzhen'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeKernelVersionResponseBody = {
  availableKernelVersions?: [ 
    {
      expireDate?: string(name='ExpireDate', description='The maintenance expiration time of the version. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. After the time arrives, the system no longer maintains the version. If any issues occur, update the minor version of the cluster to a later version.', example='2025-07-17T16:00:00Z'),
      kernelVersion?: string(name='KernelVersion', description='The minor version. Example: **3.1.9**.', example='3.1.9'),
      releaseDate?: string(name='ReleaseDate', description='The time when the minor version was released. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2024-07-17T16:00:00Z'),
    }
  ](name='AvailableKernelVersions', description='The minor versions to which you can update the current minor version of the cluster.'),
  expireDate?: string(name='ExpireDate', description='The maintenance expiration time of the version. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. After the time arrives, the system no longer maintains the version. If any issues occur, update the minor version of the cluster to a later version.', example='2025-01-12T16:00:00Z'),
  kernelVersion?: string(name='KernelVersion', description='The minor version of the cluster. Example: **3.1.8**.', example='3.1.8'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeKernelVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeKernelVersionResponseBody(name='body'),
}

/**
 * @summary Queries the information about the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeKernelVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeKernelVersionResponse
 */
async function describeKernelVersionWithOptions(request: DescribeKernelVersionRequest, runtime: Util.RuntimeOptions): DescribeKernelVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeKernelVersion',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeKernelVersionRequest
 * @return DescribeKernelVersionResponse
 */
async function describeKernelVersion(request: DescribeKernelVersionRequest): DescribeKernelVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeKernelVersionWithOptions(request, runtime);
}

model DescribeLakeCacheSizeRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='amv-bp10b6646l07akdt'),
}

model DescribeLakeCacheSizeResponseBody = {
  code?: int32(name='Code', description='The status code. The value 200 indicates that the request is successful.', example='200'),
  data?: {
    capacity?: long(name='Capacity', description='The size of the lake cache space. Unit: GB.', example='100'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-bp10b6646l07akdt'),
    dataSize?: long(name='DataSize', description='The size of the data that occupies the lake cache space. Unit: GB.', example='100'),
    enableLakeCache?: boolean(name='EnableLakeCache', description='Indicates whether the lake cache feature is enabled.', example='true'),
    instances?: [ string ](name='Instances', description='The clusters that share the lake cache space.'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeLakeCacheSizeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLakeCacheSizeResponseBody(name='body'),
}

/**
 * @summary Queries the lake cache size of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeLakeCacheSizeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLakeCacheSizeResponse
 */
async function describeLakeCacheSizeWithOptions(request: DescribeLakeCacheSizeRequest, runtime: Util.RuntimeOptions): DescribeLakeCacheSizeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLakeCacheSize',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the lake cache size of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeLakeCacheSizeRequest
 * @return DescribeLakeCacheSizeResponse
 */
async function describeLakeCacheSize(request: DescribeLakeCacheSizeRequest): DescribeLakeCacheSizeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLakeCacheSizeWithOptions(request, runtime);
}

model DescribeOperatorPermissionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeOperatorPermissionResponseBody = {
  createdTime?: string(name='CreatedTime', description='The time when the permissions take effect.', example='2024-02-25T03:35:02Z'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-uf6wjk5xxxxxxxxxx'),
  expiredTime?: string(name='ExpiredTime', description='The time when the permissions expire.', example='2024-01-10T02:19:00Z'),
  privileges?: string(name='Privileges', description='The queried permissions.', example='Control,Data'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeOperatorPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOperatorPermissionResponseBody(name='body'),
}

/**
 * @summary Queries the service account permissions of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOperatorPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOperatorPermissionResponse
 */
async function describeOperatorPermissionWithOptions(request: DescribeOperatorPermissionRequest, runtime: Util.RuntimeOptions): DescribeOperatorPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOperatorPermission',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the service account permissions of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOperatorPermissionRequest
 * @return DescribeOperatorPermissionResponse
 */
async function describeOperatorPermission(request: DescribeOperatorPermissionRequest): DescribeOperatorPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOperatorPermissionWithOptions(request, runtime);
}

model DescribeOversizeNonPartitionTableInfosRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp11q28kvl688****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

>  The end time must be later than the start time. The specified time range must be less than seven days.', example='2024-05-11T05:44Z'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh (default)**: simplified Chinese.
*   **en**: English
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format.

Example:

    [

        {

            "Field":"Name",

            "Type":"Asc"

        }

    ]

Field specifies the field by which to sort the query results. Set the value to Name. Type specifies the sorting order. Valid values: Desc and Asc.

Field and Type are case-insensitive.', example='[{"Field":"SchemaName","Type":"Asc"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

>', example='2024-05-11T05:44Z'),
}

model DescribeOversizeNonPartitionTableInfosResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp16t5ci7r74s****'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='Multiple oversized non-partitioned tables are detected.'),
      name?: string(name='Name', description='The name of the detection item.', example='Oversized non-partitioned tables'),
      status?: string(name='Status', description='The severity level of the detection result.', example='NORMAL
WARNING
CRITICAL'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  tables?: [ 
    {
      dataSize?: long(name='DataSize', description='The data size of the table. Unit: bytes.', example='2921132457984'),
      indexSize?: long(name='IndexSize', description='The data size of regular indexes. Unit: bytes.', example='111'),
      localDataSize?: long(name='LocalDataSize', description='The size of hot data. Unit: bytes.', example='1223'),
      primaryKeySize?: long(name='PrimaryKeySize', description='The data size of the primary key index. Unit: bytes.', example='123'),
      remoteDataSize?: long(name='RemoteDataSize', description='The size of cold data. Unit: bytes.', example='122'),
      rowCount?: long(name='RowCount', description='The number of rows in the table.', example='1222'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      spaceRatio?: double(name='SpaceRatio', description='The percentage of the table size. Unit: %.

>  Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.', example='0.3'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
    }
  ](name='Tables', description='The queried oversized non-partitioned tables.'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeOversizeNonPartitionTableInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOversizeNonPartitionTableInfosResponseBody(name='body'),
}

/**
 * @summary Queries the information about oversized non-partitioned tables in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOversizeNonPartitionTableInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOversizeNonPartitionTableInfosResponse
 */
async function describeOversizeNonPartitionTableInfosWithOptions(request: DescribeOversizeNonPartitionTableInfosRequest, runtime: Util.RuntimeOptions): DescribeOversizeNonPartitionTableInfosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOversizeNonPartitionTableInfos',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about oversized non-partitioned tables in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOversizeNonPartitionTableInfosRequest
 * @return DescribeOversizeNonPartitionTableInfosResponse
 */
async function describeOversizeNonPartitionTableInfos(request: DescribeOversizeNonPartitionTableInfosRequest): DescribeOversizeNonPartitionTableInfosResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOversizeNonPartitionTableInfosWithOptions(request, runtime);
}

model DescribePatternPerformanceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-uf6li1r3do8m****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

> The end time must be later than the start time.', example='2022-08-22T01:06:00Z'),
  patternId?: string(name='PatternId', description='The SQL pattern ID.

>  You can call the [DescribeSQLPatterns](https://help.aliyun.com/document_detail/321868.html) operation to query the information about all SQL patterns in an AnalyticDB for MySQL cluster within a period of time, including SQL pattern IDs.', example='3847585356974******'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> 

*   If the current date is August 22, 2022 (UTC+8), you can query the data of August 9, 2022 (2022-08-08T16:00:00Z) to the earliest extent. If you want to query the data that is earlier than August 9, 2022 (2022-08-08T16:00:00Z), null is returned.

*   The maximum time range that can be specified is 24 hours.', example='2022-08-21T02:15:00Z'),
}

model DescribePatternPerformanceResponseBody = {
  accessIp?: string(name='AccessIp'),
  endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time is displayed in UTC.', example='2022-08-22T01:06:00Z'),
  failedCount?: long(name='FailedCount'),
  performances?: [ 
    {
      key?: string(name='Key', description='The queried performance metric. Valid values:

*   **AnalyticDB_PatternQueryCount**: the total number of queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternQueryTime**: the total amount of time consumed by the queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternExecutionTime**: the execution duration of the queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternPeakMemory**: the peak memory usage of the queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternScanSize**: the amount of data scanned in the queries executed in association with the SQL pattern.', example='AnalyticDB_PatternExecutionTime'),
      series?: [ 
        {
          name?: string(name='Name', description='The name of the performance metric value. Valid values:

*   If the value of `Key` is `AnalyticDB_PatternQueryCount`, `pattern_query_count` is returned, which indicates the number of executions of the SQL statements in association with the SQL pattern.

*   If the value of `Key` is `AnalyticDB_PatternQueryTime`, the following values are returned:

    *   `average_query_time`, which indicates the average total amount of time consumed by the SQL statements in association with the SQL pattern.
    *   `max_query_time`, which indicates the maximum total amount of time consumed by the SQL statements in association with the SQL pattern.

*   If the value of `Key` is `AnalyticDB_PatternExecutionTime`, the following values are returned:

    *   `average_execution_time`, which indicates the average execution duration of the SQL statements in association with the SQL pattern.
    *   `max_execution_time`, which indicates the maximum execution duration of the SQL statements in association with the SQL pattern.

*   If the value of `Key` is `AnalyticDB_PatternPeakMemory`, the following values are returned:

    *   `average_peak_memory`, which indicates the average peak memory usage of the SQL statements in association with the SQL pattern.
    *   `max_peak_memory`, which indicates the maximum peak memory usage of the SQL statements in association with the SQL pattern.

*   If the value of `Key` is `AnalyticDB_PatternScanSize`, the following values are returned:

    *   `average_scan_size`, which indicates the average amount of data scanned by the SQL statements in association with the SQL pattern.
    *   `max_scan_size`, which indicates the maximum amount of data scanned by the SQL statements in association with the SQL pattern.', example='max_query_time'),
          values?: [ string ](name='Values', description='The values of the performance metric.'),
        }
      ](name='Series', description='The values of the performance metrics.'),
      unit?: string(name='Unit', description='The unit of the performance metric. Valid values:

*   If the performance metric is related to the query time (the value of `Key` is `AnalyticDB_PatternQueryTime` or `AnalyticDB_PatternExecutionTime`), **ms** is returned.
*   If the performance metric is related to the peak memory usage (the value of `Key` is `AnalyticDB_PatternPeakMemory`), **MB** is returned.
*   If the performance metric is related to the amount of data scanned (the value of `Key` is `AnalyticDB_PatternScanSize`), **MB** is returned.
*   If the performance metric is related to the number of queries (the value of `Key` is `AnalyticDB_PatternQueryCount`), null is returned.', example='ms'),
    }
  ](name='Performances', description='The queried performance metrics.'),
  queryCount?: long(name='QueryCount'),
  requestId?: string(name='RequestId', description='The request ID.', example='F21AF487-B8C9-57E0-8E3A-A92BC3611FB6'),
  SQLPattern?: string(name='SQLPattern'),
  startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time is displayed in UTC.', example='2022-08-21T02:15:00Z'),
  tables?: string(name='Tables'),
  user?: string(name='User'),
}

model DescribePatternPerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePatternPerformanceResponseBody(name='body'),
}

/**
 * @summary Queries the information about performance metrics of an SQL pattern such as the query duration and average memory usage for an AnalyticDB for MySQL cluster within a time range.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribePatternPerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePatternPerformanceResponse
 */
async function describePatternPerformanceWithOptions(request: DescribePatternPerformanceRequest, runtime: Util.RuntimeOptions): DescribePatternPerformanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.patternId)) {
    query['PatternId'] = request.patternId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePatternPerformance',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about performance metrics of an SQL pattern such as the query duration and average memory usage for an AnalyticDB for MySQL cluster within a time range.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribePatternPerformanceRequest
 * @return DescribePatternPerformanceResponse
 */
async function describePatternPerformance(request: DescribePatternPerformanceRequest): DescribePatternPerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePatternPerformanceWithOptions(request, runtime);
}

model DescribePerformanceViewAttributeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-bp11q28kvl688****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  viewName?: string(name='ViewName', description='The name of the view.

This parameter is required.', example='Basic'),
}

model DescribePerformanceViewAttributeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.

>  This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  createFromViewType?: string(name='CreateFromViewType', description='The type of the view.', example='Basic'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.', example='amv-bp198m028ih55xxxx'),
  fillOriginViewKeys?: boolean(name='FillOriginViewKeys', description='Specifies whether to populate the names of the metrics in the original monitoring view when you view the monitoring view. Valid values:

*   **true**
*   **false**', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='E031AABF-BD56-5966-A063-4283EF18DB45'),
  viewDetail?: {
    categories?: [ 
      {
        category?: string(name='Category', description='The name of the metric category. Valid values:

*   **Node**
*   **DiskData**
*   **WorkLoad**
*   **ResourceGroup**', example='Node'),
        keys?: [ 
          {
            enableAutoMc?: boolean(name='EnableAutoMc', description='Indicates whether the multi-cluster feature is enabled. Valid values:

- true

- false', example='true'),
            engine?: [ string ](name='Engine', description='The database engine of the cluster. Valid values:

*  AnalyticDB'),
            groupType?: [ string ](name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

>  For more information about resource groups, see [Resource group overview](https://help.aliyun.com/document_detail/428610.html).'),
            keyName?: string(name='KeyName', description='The name of the metric.', example='AnalyticDB_CPU'),
            selected?: boolean(name='Selected', description='Specifies whether to select the metric. Valid values:

*   **true**
*   **false**', example='true'),
          }
        ](name='Keys', description='The metrics.'),
      }
    ](name='Categories', description='The metric category.'),
    chartLinked?: boolean(name='ChartLinked', description='Specifies whether to enable the filter interaction feature. Valid values:

*   **true**
*   **false**', example='true'),
    chartsPerLine?: int32(name='ChartsPerLine', description='The number of charts to display in each row.', example='2'),
  }(name='ViewDetail', description='The information about the monitoring view.'),
  viewName?: string(name='ViewName', description='The name of the view.', example='Basic'),
}

model DescribePerformanceViewAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePerformanceViewAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the information about a monitoring view.
 *
 * @param request DescribePerformanceViewAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePerformanceViewAttributeResponse
 */
async function describePerformanceViewAttributeWithOptions(request: DescribePerformanceViewAttributeRequest, runtime: Util.RuntimeOptions): DescribePerformanceViewAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.viewName)) {
    query['ViewName'] = request.viewName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePerformanceViewAttribute',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a monitoring view.
 *
 * @param request DescribePerformanceViewAttributeRequest
 * @return DescribePerformanceViewAttributeResponse
 */
async function describePerformanceViewAttribute(request: DescribePerformanceViewAttributeRequest): DescribePerformanceViewAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePerformanceViewAttributeWithOptions(request, runtime);
}

model DescribePerformanceViewsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-bp1ub9grke1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePerformanceViewsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.

>  This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  requestId?: string(name='RequestId', description='The request ID.', example='3A8F6106-6AFD-5A34-9C80-8DE2C42D06E8'),
  views?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when created.', example='2024-06-18T07:06:53.000+00:00'),
      updateTime?: string(name='UpdateTime', description='The time when updated.', example='2024-06-18T07:07:32.000+00:00'),
      viewName?: string(name='ViewName', description='The name of the view.', example='Basic'),
    }
  ](name='Views', description='the list of view.'),
}

model DescribePerformanceViewsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePerformanceViewsResponseBody(name='body'),
}

/**
 * @summary Queries a list of monitoring views.
 *
 * @param request DescribePerformanceViewsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePerformanceViewsResponse
 */
async function describePerformanceViewsWithOptions(request: DescribePerformanceViewsRequest, runtime: Util.RuntimeOptions): DescribePerformanceViewsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePerformanceViews',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of monitoring views.
 *
 * @param request DescribePerformanceViewsRequest
 * @return DescribePerformanceViewsResponse
 */
async function describePerformanceViews(request: DescribePerformanceViewsRequest): DescribePerformanceViewsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePerformanceViewsWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language that is used for the region and zone names indicated by the LocalName parameter in the response parameters. Valid values:

*   **zh-CN** (default): simplified Chinese.
*   **en-US**: English.
*   **ja**: Japanese.', example='en-US'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName', description='The name of the region.', example='China (Hangzhou)'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of the region.', example='adb.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      zones?: {
        zone?: [ 
        {
          localName?: string(name='LocalName', description='The name of the zone.', example='Hangzhou Zone H'),
          vpcEnabled?: boolean(name='VpcEnabled', description='Indicates whether Virtual Private Cloud (VPC) is supported in the zone. Valid values:

*   **true**
*   **false**', example='true'),
          zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-h'),
        }
      ](name='Zone')
      }(name='Zones', description='The queried zones.'),
    }
  ](name='Region')
  }(name='Regions', description='The queried regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='421794A3-72A5-5D27-9E8B-A75A4C503E17'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries a list of regions and zones in which AnalyticDB for MySQL Data Lakehouse Edition (V3.0) is available.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of regions and zones in which AnalyticDB for MySQL Data Lakehouse Edition (V3.0) is available.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeResourceGroupSpecRequest {
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='amv-8vbo40tl1dxxxxxx'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceGroupType?: string(name='ResourceGroupType', description='This parameter is required.', example='ai'),
}

model DescribeResourceGroupSpecResponseBody = {
  requestId?: string(name='RequestId', description='requestId', example='10226189-4391-5B10-97AF-5CA5XXXXXXX'),
  specs?: [ 
    {
      allocateUnits?: [ string ](name='AllocateUnits'),
      maxQuantity?: int32(name='MaxQuantity', example='8'),
      name?: string(name='Name', example='xlarge'),
      type?: string(name='Type', example='GPU'),
    }
  ](name='Specs'),
}

model DescribeResourceGroupSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResourceGroupSpecResponseBody(name='body'),
}

/**
 * @summary 查询资源组规格相关信息
 *
 * @param request DescribeResourceGroupSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResourceGroupSpecResponse
 */
async function describeResourceGroupSpecWithOptions(request: DescribeResourceGroupSpecRequest, runtime: Util.RuntimeOptions): DescribeResourceGroupSpecResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupType)) {
    query['ResourceGroupType'] = request.resourceGroupType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResourceGroupSpec',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询资源组规格相关信息
 *
 * @param request DescribeResourceGroupSpecRequest
 * @return DescribeResourceGroupSpecResponse
 */
async function describeResourceGroupSpec(request: DescribeResourceGroupSpecRequest): DescribeResourceGroupSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceGroupSpecWithOptions(request, runtime);
}

model DescribeSQLPatternsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region, including cluster IDs.

This parameter is required.', example='amv-8vb8de93v9b****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> The end time must be later than the start time.', example='2022-09-07T03:06:00Z'),
  keyword?: string(name='Keyword', description='The keyword that is used for the query.', example='SELECT'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"AverageQueryTime","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `PatternCreationTime`: the earliest commit time of the SQL pattern within the time range to query.
    *   `AverageQueryTime`: the average total amount of time consumed by the SQL pattern within the time range to query.
    *   `MaxQueryTime`: the maximum total amount of time consumed by the SQL pattern within the time range to query.
    *   `AverageExecutionTime`: the average execution duration of the SQL pattern within the time range to query.
    *   `MaxExecutionTime`: the maximum execution duration of the SQL pattern within the time range to query.
    *   `AveragePeakMemory`: the average peak memory usage of the SQL pattern within the time range to query.
    *   `MaxPeakMemory`: the maximum peak memory usage of the SQL pattern within the time range to query.
    *   `AverageScanSize`: the average amount of data scanned based on the SQL pattern within the time range to query.
    *   `MaxScanSize`: the maximum amount of data scanned based on the SQL pattern within the time range to query.
    *   `QueryCount`: the number of queries performed in association with the SQL pattern within the time range to query.
    *   `FailedCount`: the number of failed queries performed in association with the SQL pattern within the time range to query.

*   `Type` specifies the sorting order. Valid values (case-insensitive):

    *   `Asc`: ascending order.
    *   `Desc`: descending order.', example='[{"Field":"AverageQueryTime","Type":"Asc"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='2'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **10** (default)
*   **30**
*   **50**
*   **100**', example='10'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> *   Only data within the last 14 days can be queried.
> * The maximum time range that can be specified is 24 hours.', example='2022-09-06T03:06:00Z'),
}

model DescribeSQLPatternsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial. This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='2'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  patternDetails?: [ 
    {
      accessIp?: string(name='AccessIp', description='The IP address of the SQL client that commits the SQL pattern.', example='192.168.xx.xx'),
      averageExecutionTime?: double(name='AverageExecutionTime', description='The average execution duration of the SQL pattern within the query time range. Unit: milliseconds.', example='234.78'),
      averageOperatorCost?: double(name='AverageOperatorCost'),
      averagePeakMemory?: double(name='AveragePeakMemory', description='The average peak memory usage of the SQL pattern within the query time range. Unit: bytes.', example='234.22'),
      averageQueryTime?: double(name='AverageQueryTime', description='The average total amount of time consumed by the SQL pattern within the query time range. Unit: milliseconds.', example='4'),
      averageScanCost?: double(name='AverageScanCost'),
      averageScanSize?: double(name='AverageScanSize', description='The average amount of data scanned based on the SQL pattern within the query time range. Unit: bytes.', example='234149.23'),
      blockable?: boolean(name='Blockable', description='Indicates whether the execution of the SQL pattern can be intercepted. Valid values:

*   **true**
*   **false**

>  Only SELECT and INSERT statements can be intercepted.', example='true'),
      failedCount?: long(name='FailedCount', description='The number of failed queries executed in association with the SQL pattern within the query time range.', example='18'),
      maxExecutionTime?: long(name='MaxExecutionTime', description='The maximum execution duration of the SQL pattern within the query time range. Unit: milliseconds.', example='2142'),
      maxOperatorCost?: double(name='MaxOperatorCost'),
      maxPeakMemory?: long(name='MaxPeakMemory', description='The maximum peak memory usage of the SQL pattern within the query time range. Unit: bytes.', example='234149'),
      maxQueryTime?: long(name='MaxQueryTime', description='The maximum total amount of time consumed by the SQL pattern within the query time range. Unit: milliseconds.', example='2341'),
      maxScanCost?: double(name='MaxScanCost'),
      maxScanSize?: long(name='MaxScanSize', description='The maximum amount of data scanned based on the SQL pattern within the query time range. Unit: bytes.', example='32212254'),
      operatorCostPercentage?: double(name='OperatorCostPercentage'),
      operatorCostSum?: double(name='OperatorCostSum'),
      patternCreationTime?: string(name='PatternCreationTime', description='The earliest commit time of the SQL pattern within the query time range.', example='2022-09-06 05:06:00'),
      patternId?: string(name='PatternId', description='The ID of the SQL pattern.', example='5575924945138******'),
      peakMemoryPercentage?: double(name='PeakMemoryPercentage'),
      peakMemorySum?: double(name='PeakMemorySum'),
      queryCount?: long(name='QueryCount', description='The number of queries executed in association with the SQL pattern within the query time range.', example='345'),
      queryTimePercentage?: double(name='QueryTimePercentage'),
      queryTimeSum?: double(name='QueryTimeSum'),
      SQLPattern?: string(name='SQLPattern', description='The statement of the SQL pattern.', example='SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?)'),
      scanCostPercentage?: double(name='ScanCostPercentage'),
      scanCostSum?: double(name='ScanCostSum'),
      scanSizePercentage?: double(name='ScanSizePercentage'),
      scanSizeSum?: double(name='ScanSizeSum'),
      tables?: string(name='Tables', description='The tables scanned based on the SQL pattern.', example='tpch.orders'),
      user?: string(name='User', description='The name of the database account that is used to commit the SQL pattern.', example='test'),
    }
  ](name='PatternDetails', description='The queried SQL patterns.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F3174013-5B7A-5A47-9FE0-6B5D397BD86B'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='20'),
}

model DescribeSQLPatternsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLPatternsResponseBody(name='body'),
}

/**
 * @summary Queries a list of SQL patterns for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster within a time range.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSQLPatternsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLPatternsResponse
 */
async function describeSQLPatternsWithOptions(request: DescribeSQLPatternsRequest, runtime: Util.RuntimeOptions): DescribeSQLPatternsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLPatterns',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of SQL patterns for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster within a time range.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSQLPatternsRequest
 * @return DescribeSQLPatternsResponse
 */
async function describeSQLPatterns(request: DescribeSQLPatternsRequest): DescribeSQLPatternsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLPatternsWithOptions(request, runtime);
}

model DescribeSchemasRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1xxxxxxxx47'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeSchemasResponseBody = {
  items?: {
    schema?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp11q28kvl688****'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
    }
  ](name='Schema')
  }(name='Items', description='The queried databases.'),
  requestId?: string(name='RequestId', description='The request ID.', example='25B56BC7-4978-40B3-9E48-4B7067******'),
}

model DescribeSchemasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSchemasResponseBody(name='body'),
}

/**
 * @summary Queries a list of databases in an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSchemasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSchemasResponse
 */
async function describeSchemasWithOptions(request: DescribeSchemasRequest, runtime: Util.RuntimeOptions): DescribeSchemasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSchemas',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of databases in an AnalyticDB for MySQL cluster.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSchemasRequest
 * @return DescribeSchemasResponse
 */
async function describeSchemas(request: DescribeSchemasRequest): DescribeSchemasResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSchemasWithOptions(request, runtime);
}

model DescribeSparkAppDiagnosisInfoRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query all application IDs.

This parameter is required.', example='s202411061017sh0ad564b000****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/98094.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-uf663j39b0jd2***'),
  language?: string(name='Language', description='The execution language of the Spark application.

This parameter is required.', example='PYTHON'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeSparkAppDiagnosisInfoResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query all application IDs.', example='s202404141952sz6a1391200****'),
  cpuUtilization?: double(name='CpuUtilization', description='The CPU utilization. Unit: %.', example='100'),
  diagnosisInfoList?: [
    Adb4MysqlSparkDiagnosisInfo
  ](name='DiagnosisInfoList', description='The queried diagnostic information.'),
  durationInMillis?: long(name='DurationInMillis', description='The execution duration of the application. Unit: milliseconds.', example='281063'),
  JVMGcCostInMillis?: long(name='JVMGcCostInMillis', description='The amount of time consumed by the Java virtual machine to perform garbage collection operations. Unit: milliseconds.', example='81055'),
  peakMemoryInByte?: long(name='PeakMemoryInByte', description='The peak memory usage. Unit: bytes.', example='4096000'),
  requestId?: string(name='RequestId', description='The request ID.', example='FB5AC339-91F6-5000-8E5A-F47065B01B87'),
  shuffleReadInByte?: long(name='ShuffleReadInByte', description='The amount of data used for shuffle reads. Unit: bytes.', example='4096000'),
  shuffleWriteInByte?: long(name='ShuffleWriteInByte', description='The amount of data used for shuffle writes. Unit: bytes.', example='4096000'),
  spillInByte?: long(name='SpillInByte', description='The amount of data spilled to disks when the memory is insufficient. Unit: bytes.', example='0'),
  startedTime?: long(name='StartedTime', description='The time when the application started to be executed.', example='1718329831000'),
  state?: string(name='State', description='The status of the asynchronous import or export job. Valid values:

*   **RUNNING**
*   **FINISHED**
*   **FAILED**', example='FINISHED'),
}

model DescribeSparkAppDiagnosisInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSparkAppDiagnosisInfoResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic information about a Spark application.
 *
 * @param request DescribeSparkAppDiagnosisInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSparkAppDiagnosisInfoResponse
 */
async function describeSparkAppDiagnosisInfoWithOptions(request: DescribeSparkAppDiagnosisInfoRequest, runtime: Util.RuntimeOptions): DescribeSparkAppDiagnosisInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSparkAppDiagnosisInfo',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic information about a Spark application.
 *
 * @param request DescribeSparkAppDiagnosisInfoRequest
 * @return DescribeSparkAppDiagnosisInfoResponse
 */
async function describeSparkAppDiagnosisInfo(request: DescribeSparkAppDiagnosisInfoRequest): DescribeSparkAppDiagnosisInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSparkAppDiagnosisInfoWithOptions(request, runtime);
}

model DescribeSparkAppTypeRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/612475.html) operation to query the Spark application IDs.

This parameter is required.', example='s202407161205sza4c07c1000****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/98094.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-wz9w49b12933****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-shenzhen'),
}

model DescribeSparkAppTypeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The detailed reason why the access was denied.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  requestId?: string(name='RequestId', description='The request ID.', example='596AF63B-8798-501E-BA06-CD2184D48A35'),
  type?: string(name='Type', description='The type of the Spark application. Valid values:

*   BATCH
*   SQLENGINE', example='Batch'),
}

model DescribeSparkAppTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSparkAppTypeResponseBody(name='body'),
}

/**
 * @summary Queries the type of a Spark application.
 *
 * @param request DescribeSparkAppTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSparkAppTypeResponse
 */
async function describeSparkAppTypeWithOptions(request: DescribeSparkAppTypeRequest, runtime: Util.RuntimeOptions): DescribeSparkAppTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSparkAppType',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the type of a Spark application.
 *
 * @param request DescribeSparkAppTypeRequest
 * @return DescribeSparkAppTypeResponse
 */
async function describeSparkAppType(request: DescribeSparkAppTypeRequest): DescribeSparkAppTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSparkAppTypeWithOptions(request, runtime);
}

model DescribeSparkCodeLogRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-uf6o6m8p6x7v****'),
  jobId?: long(name='JobId', description='The ID of the Spark job.

This parameter is required.', example='1248'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeSparkCodeLogResponseBody = {
  log?: string(name='Log', description='The content of the log.', example='>>>>>>>> stdout:n++++++++++++++++++executing sql: MSCK REPAIR TABLE  `footprint_ethereum`.`dwd_eth_eth_txr_v2_di` n++n'),
  message?: string(name='Message', description='The returned message.

*   If the request was successful, **Success** is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CD65640-9963-5D60-929C-118F2C84070E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model DescribeSparkCodeLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSparkCodeLogResponseBody(name='body'),
}

/**
 * @summary Queries the execution logs of Spark code.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSparkCodeLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSparkCodeLogResponse
 */
async function describeSparkCodeLogWithOptions(request: DescribeSparkCodeLogRequest, runtime: Util.RuntimeOptions): DescribeSparkCodeLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSparkCodeLog',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution logs of Spark code.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSparkCodeLogRequest
 * @return DescribeSparkCodeLogResponse
 */
async function describeSparkCodeLog(request: DescribeSparkCodeLogRequest): DescribeSparkCodeLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSparkCodeLogWithOptions(request, runtime);
}

model DescribeSparkCodeOutputRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-uf6210mmev07****'),
  jobId?: long(name='JobId', description='The ID of the Spark job.

This parameter is required.', example='620'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeSparkCodeOutputResponseBody = {
  message?: string(name='Message', description='The returned message.

*   If the request was successful, **Success** is returned.
*   If the request failed, an error message is returned.', example='Success'),
  output?: string(name='Output', description='The execution result, which is in the format of JSON objects.', example='"{\\\\"schema\\\\":[\\\\"id\\\\",\\\\"name\\\\",\\\\"age\\\\"],\\\\"data\\\\":[\\\\"{\\\\\\\\\\\\"id\\\\\\\\\\\\":10,\\\\\\\\\\\\"name\\\\\\\\\\\\":\\\\\\\\\\\\"z\\\\\\\\\\\\",\\\\\\\\\\\\"age\\\\\\\\\\\\":123}\\\\",\\\\"{\\\\\\\\\\\\"id\\\\\\\\\\\\":2,\\\\\\\\\\\\"name\\\\\\\\\\\\":\\\\\\\\\\\\"b\\\\\\\\\\\\",\\\\\\\\\\\\"age\\\\\\\\\\\\":17}\\\\",\\\\"{\\\\\\\\\\\\"id\\\\\\\\\\\\":1,\\\\\\\\\\\\"name\\\\\\\\\\\\":\\\\\\\\\\\\"a\\\\\\\\\\\\",\\\\\\\\\\\\"age\\\\\\\\\\\\":15}\\\\",\\\\"{\\\\\\\\\\\\"id\\\\\\\\\\\\":3,\\\\\\\\\\\\"name\\\\\\\\\\\\":\\\\\\\\\\\\"c\\\\\\\\\\\\",\\\\\\\\\\\\"age\\\\\\\\\\\\":222}\\\\",\\\\"{\\\\\\\\\\\\"id\\\\\\\\\\\\":10,\\\\\\\\\\\\"name\\\\\\\\\\\\":\\\\\\\\\\\\"z\\\\\\\\\\\\",\\\\\\\\\\\\"age\\\\\\\\\\\\":123}\\\\"],\\\\"haveRows\\\\":true,\\\\"rowNumber\\\\":6}"'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model DescribeSparkCodeOutputResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSparkCodeOutputResponseBody(name='body'),
}

/**
 * @summary Queries the execution result of Spark code.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSparkCodeOutputRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSparkCodeOutputResponse
 */
async function describeSparkCodeOutputWithOptions(request: DescribeSparkCodeOutputRequest, runtime: Util.RuntimeOptions): DescribeSparkCodeOutputResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSparkCodeOutput',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution result of Spark code.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSparkCodeOutputRequest
 * @return DescribeSparkCodeOutputResponse
 */
async function describeSparkCodeOutput(request: DescribeSparkCodeOutputRequest): DescribeSparkCodeOutputResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSparkCodeOutputWithOptions(request, runtime);
}

model DescribeSparkCodeWebUiRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp1v6usq6m65****'),
  jobId?: long(name='JobId', description='The ID of the Spark job.

This parameter is required.', example='1248'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeSparkCodeWebUiResponseBody = {
  message?: string(name='Message', description='The returned message.

*   If the request was successful, **SUCCESS** is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='774DDC37-1908-58F6-B9CA-99E3E45965A6'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
  url?: string(name='Url', description='The URL of the web UI for the Spark application.', example='https://adb-subuser-cn-hangzhou-1358535755648527-100000648.oss-cn-hangzhou.aliyuncs.com/%3Facl?Expires=1681295967&OSSAccessKeyId=LTAI5tB7NAkm25oiGASu****&Signature=hKAZ1vgvhJ%2FD8hNHTuX%2FOOBWht****'),
}

model DescribeSparkCodeWebUiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSparkCodeWebUiResponseBody(name='body'),
}

/**
 * @summary Queries the URL of the web UI for a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSparkCodeWebUiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSparkCodeWebUiResponse
 */
async function describeSparkCodeWebUiWithOptions(request: DescribeSparkCodeWebUiRequest, runtime: Util.RuntimeOptions): DescribeSparkCodeWebUiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSparkCodeWebUi',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the URL of the web UI for a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeSparkCodeWebUiRequest
 * @return DescribeSparkCodeWebUiResponse
 */
async function describeSparkCodeWebUi(request: DescribeSparkCodeWebUiRequest): DescribeSparkCodeWebUiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSparkCodeWebUiWithOptions(request, runtime);
}

model DescribeSparkSQLDiagnosisAttributeRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/612475.html) operation to query a list of Spark application IDs.

This parameter is required.', example='s202411071444hzdvk486d9d2001****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> 

*   You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/98094.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-2zeq4788qyy7k662'),
  innerQueryId?: long(name='InnerQueryId', description='The ID of the query executed within the Spark application.

This parameter is required.', example='1'),
  language?: string(name='Language', description='The language in which to return the query results. Valid values:

*   en: English.
*   zh: Chinese.

This parameter is required.', example='zh'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeSparkSQLDiagnosisAttributeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial.', example='{}'),
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/612475.html) operation to query a list of Spark application IDs.', example='s202411071444hzdvk486d9d2001****'),
  diagnosisInfos?: [
    Adb4MysqlSparkDiagnosisInfo
  ](name='DiagnosisInfos', description='The queried diagnostic information.'),
  elapsedTime?: long(name='ElapsedTime', description='The execution duration of the query. Unit: milliseconds.', example='100'),
  innerQueryId?: long(name='InnerQueryId', description='The ID of the query executed within the Spark application.', example='1'),
  operatorListSortedByMetrics?: {
    operatorListSortedByExclusiveTime?: [
      SparkOperatorInfo
    ](name='OperatorListSortedByExclusiveTime', description='The operators sorted by the execution duration.'),
    operatorListSortedByMaxMemory?: [
      SparkOperatorInfo
    ](name='OperatorListSortedByMaxMemory', description='The operators sorted by the maximum memory used.'),
  }(name='OperatorListSortedByMetrics', description='The operators sorted by metrics.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  root?: OperatorNode(name='Root', description='The Spark execution plan tree.'),
}

model DescribeSparkSQLDiagnosisAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSparkSQLDiagnosisAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic information about a Spark SQL query.
 *
 * @param request DescribeSparkSQLDiagnosisAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSparkSQLDiagnosisAttributeResponse
 */
async function describeSparkSQLDiagnosisAttributeWithOptions(request: DescribeSparkSQLDiagnosisAttributeRequest, runtime: Util.RuntimeOptions): DescribeSparkSQLDiagnosisAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.innerQueryId)) {
    query['InnerQueryId'] = request.innerQueryId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSparkSQLDiagnosisAttribute',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic information about a Spark SQL query.
 *
 * @param request DescribeSparkSQLDiagnosisAttributeRequest
 * @return DescribeSparkSQLDiagnosisAttributeResponse
 */
async function describeSparkSQLDiagnosisAttribute(request: DescribeSparkSQLDiagnosisAttributeRequest): DescribeSparkSQLDiagnosisAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSparkSQLDiagnosisAttributeWithOptions(request, runtime);
}

model DescribeSparkSQLDiagnosisListRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region, including cluster IDs.

This parameter is required.', example='amv-2zez35ww415xjwk5'),
  maxStartTime?: string(name='MaxStartTime', description='The latest start time.', example='2024-11-28 23:00:00'),
  minStartTime?: string(name='MinStartTime', description='The earliest start time.', example='2024-11-28 22:00:00'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"MaxExclusiveTime","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `MaxExclusiveTime`: the maximum execution duration.
    *   `PeakMemory`: the peak memory.
    *   `QueryStartTime`: the start time of the query.
    *   `QueryWallclockTime`: the execution duration of the query.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

> 

*   If you do not specify this parameter, query results are sorted by `MaxExclusiveTime` in ascending order.', example='[{\\\\"Field\\\\":\\\\"QueryStartTime\\\\",\\\\"Type\\\\":\\\\"Desc\\\\"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  statementId?: long(name='StatementId', description='The unique ID of the code block in the Spark job.', example='123'),
}

model DescribeSparkSQLDiagnosisListResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial.', example='{}'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='A91C9D07-7462-5F35-BB47-83629CE6CCAC'),
  SQLDiagnosisList?: [ 
    {
      appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/612475.html) operation to query a list of Spark application IDs.', example='s202404291020bjd448ad40002122'),
      elapsedTime?: long(name='ElapsedTime', description='The execution duration of the query. Unit: milliseconds.', example='100'),
      innerQueryId?: long(name='InnerQueryId', description='The ID of the query executed within the Spark application.', example='1'),
      maxExclusiveTime?: long(name='MaxExclusiveTime', description='The maximum operator execution duration. Unit: milliseconds.', example='90'),
      peakMemory?: long(name='PeakMemory', description='The maximum operator memory used. Unit: bytes.', example='1024'),
      SQL?: string(name='SQL', description='The SQL statement.', example='select * from device where name = \\\\"105506012112790031\\\\"'),
      scanRowCount?: long(name='ScanRowCount', description='The number of entries scanned.', example='100'),
      startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time is displayed in UTC.', example='2024-11-20 09:09:00'),
      state?: string(name='State', description='The execution status of the query. Valid values:

*   COMPLETED
*   CANCELED
*   ABORTED
*   FAILED', example='COMPLETED'),
      statementId?: long(name='StatementId', description='The unique ID of the code block in the Spark job.', example='1'),
    }
  ](name='SQLDiagnosisList', description='The queried diagnostic information.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1343'),
}

model DescribeSparkSQLDiagnosisListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSparkSQLDiagnosisListResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic information about Spark SQL queries.
 *
 * @param request DescribeSparkSQLDiagnosisListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSparkSQLDiagnosisListResponse
 */
async function describeSparkSQLDiagnosisListWithOptions(request: DescribeSparkSQLDiagnosisListRequest, runtime: Util.RuntimeOptions): DescribeSparkSQLDiagnosisListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.maxStartTime)) {
    query['MaxStartTime'] = request.maxStartTime;
  }
  if (!Util.isUnset(request.minStartTime)) {
    query['MinStartTime'] = request.minStartTime;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.statementId)) {
    query['StatementId'] = request.statementId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSparkSQLDiagnosisList',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic information about Spark SQL queries.
 *
 * @param request DescribeSparkSQLDiagnosisListRequest
 * @return DescribeSparkSQLDiagnosisListResponse
 */
async function describeSparkSQLDiagnosisList(request: DescribeSparkSQLDiagnosisListRequest): DescribeSparkSQLDiagnosisListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSparkSQLDiagnosisListWithOptions(request, runtime);
}

model DescribeSqlPatternRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-bp1ej1nq9n6****'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON string format. Example: `[{"Field":"Pattern","Type":"Asc"}]`. Parameters:

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `Pattern`: the SQL pattern.
    *   `AccessIP`: the IP address of the client.
    *   `User`: the username.
    *   `QueryCount`: the number of queries performed in association with the SQL pattern within the time range to query.
    *   `AvgPeakMemory`: the average peak memory usage of the SQL pattern within the time range to query. Unit: KB.
    *   `MaxPeakMemory`: the maximum peak memory usage of the SQL pattern within the time range to query. Unit: KB.
    *   `AvgCpuTime`: the average execution duration of the SQL pattern within the time range to query. Unit: milliseconds.
    *   `MaxCpuTime`: the maximum execution duration of the SQL pattern within the time range to query. Unit: milliseconds.
    *   `AvgStageCount`: the average number of stages.
    *   `MaxStageCount`: the maximum number of stages.
    *   `AvgTaskCount`: the average number of tasks.
    *   `MaxTaskCount`: the maximum number of tasks.
    *   `AvgScanSize`: the average amount of data scanned based on the SQL pattern within the time range to query. Unit: KB.
    *   `MaxScanSize`: the maximum amount of data scanned based on the SQL pattern within the time range to query. Unit: KB.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

> 

*   If you do not specify this parameter, query results are sorted in ascending order of `Pattern`.

*   If you want to sort query results by `AccessIP`, you must set the `Type` parameter to `accessip`. If you want to sort query results by `User`, you must leave the `Type` parameter empty or set it to `user`.', example='[{"Field":"Pattern","Type":"Asc"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='2'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **10** (default)
*   **30**
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  sqlPattern?: string(name='SqlPattern', description='The keyword that is used for the query.

> If you do not specify this parameter, all SQL patterns of the AnalyticDB for MySQL cluster within the time period specified by `StartTime` are returned.', example='SELECT'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-dd format. The time must be in UTC.

> Only data within the last 30 days can be queried.', example='2022-08-30T12:10:00Z'),
  type?: string(name='Type', description='The dimension by which to aggregate the SQL patterns. Valid values:

*   `user`: aggregates the SQL patterns by user.
*   `accessip`: aggregates the SQL patterns by client IP address.

> If you do not specify this parameter, the SQL patterns are aggregated by `user`.', example='user'),
}

model DescribeSqlPatternResponseBody = {
  items?: [ 
    {
      accessIP?: string(name='AccessIP', description='The IP address of the client.

>  This parameter is returned only when **Type** is set to **accessip**.', example='100.104.xx.xx'),
      avgCpuTime?: string(name='AvgCpuTime', description='The average execution duration of the SQL pattern within the query time range. Unit: milliseconds.', example='1.0625'),
      avgPeakMemory?: string(name='AvgPeakMemory', description='The average peak memory usage of the SQL pattern within the query time range. Unit: KB.', example='240048'),
      avgScanSize?: string(name='AvgScanSize', description='The average amount of data scanned based on the SQL pattern within the query time range. Unit: KB.', example='244'),
      avgStageCount?: string(name='AvgStageCount', description='The average number of scanned rows.', example='2'),
      avgTaskCount?: string(name='AvgTaskCount', description='The average number of tasks.', example='2'),
      instanceName?: string(name='InstanceName', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.', example='amv-bp1ej1nq9n6****'),
      maxCpuTime?: string(name='MaxCpuTime', description='The maximum execution duration of the SQL pattern within the query time range. Unit: milliseconds.', example='17'),
      maxPeakMemory?: string(name='MaxPeakMemory', description='The maximum peak memory usage of the SQL pattern within the query time range. Unit: KB.', example='480096'),
      maxScanSize?: string(name='MaxScanSize', description='The maximum amount of data scanned based on the SQL pattern within the query time range. Unit: KB.', example='1024'),
      maxStageCount?: string(name='MaxStageCount', description='The maximum number of stages.', example='2'),
      maxTaskCount?: string(name='MaxTaskCount', description='The maximum number of tasks.', example='2'),
      pattern?: string(name='Pattern', description='The SQL pattern.', example='SELECT table_name, table_schema AS schema_name, create_time, create_time AS last_ddl_time, table_comment AS description , ceil((data_length + index_length) / ? / ?) AS store_capacity , data_length AS data_bytes, index_length AS index_bytes, table_collation AS collation, auto_increment, table_rows AS num_rows , engine FROM information_schema.tables WHERE table_type != ? AND table_schema = ? AND table_name IN (?) ORDER BY 1'),
      queryCount?: string(name='QueryCount', description='The number of queries performed in association with the SQL pattern within the query time range.', example='16'),
      reportDate?: string(name='ReportDate', description='The start date of the query.', example='2022-08-30'),
      user?: string(name='User', description='The username.

>  This parameter is returned only when **Type** is left empty or set to **user**.', example='test_acc'),
    }
  ](name='Items', description='The queried SQL pattern.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='2'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='DB1F6C23-CBCA-5260-9366-BA7BB5EBF6F1'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='50'),
}

model DescribeSqlPatternResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSqlPatternResponseBody(name='body'),
}

/**
 * @summary Queries the information about SQL patterns of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster within a time range.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeSqlPatternRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSqlPatternResponse
 */
async function describeSqlPatternWithOptions(request: DescribeSqlPatternRequest, runtime: Util.RuntimeOptions): DescribeSqlPatternResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sqlPattern)) {
    query['SqlPattern'] = request.sqlPattern;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSqlPattern',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about SQL patterns of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster within a time range.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeSqlPatternRequest
 * @return DescribeSqlPatternResponse
 */
async function describeSqlPattern(request: DescribeSqlPatternRequest): DescribeSqlPatternResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSqlPatternWithOptions(request, runtime);
}

model DescribeStorageResourceUsageRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp10yt0gva71ei7d'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2022-08-23T01:06:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2022-08-22T01:06:00Z'),
}

model DescribeStorageResourceUsageResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    acuInfo?: [ 
      {
        name?: string(name='Name', description='The resource usage metric. Valid values:

*   `TotalAcuNumber`: the total number of ACUs.
*   `ReservedAcuNumber`: the number of ACUs for the reserved resources.', example='TotalAcuNumber'),
        values?: [ string ](name='Values', description='The values of the metric at specific points in time.'),
      }
    ](name='AcuInfo', description='The AnalyticDB compute unit (ACU) usage of the cluster.'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-bp1bg858bo8c****'),
    endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-08-23T01:06:00Z'),
    startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-08-22T01:06:00Z'),
  }(name='Data', description='The queried resource usage.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEAW'),
}

model DescribeStorageResourceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeStorageResourceUsageResponseBody(name='body'),
}

/**
 * @summary Queries the storage resource usage of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeStorageResourceUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeStorageResourceUsageResponse
 */
async function describeStorageResourceUsageWithOptions(request: DescribeStorageResourceUsageRequest, runtime: Util.RuntimeOptions): DescribeStorageResourceUsageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeStorageResourceUsage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the storage resource usage of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeStorageResourceUsageRequest
 * @return DescribeStorageResourceUsageResponse
 */
async function describeStorageResourceUsage(request: DescribeStorageResourceUsageRequest): DescribeStorageResourceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeStorageResourceUsageWithOptions(request, runtime);
}

model DescribeTableAccessCountRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-2ze627uzpkh8a8****'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON string format. Example: `[{"Field":"TableSchema","Type":"Asc"}]`. Fields in the request parameter:

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `TableSchema`: the name of the database to which the table belongs.
    *   `TableName`: the name of the table.
    *   `AccessCount`: the number of accesses to the table.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, query results are sorted in ascending order based on the database and the table.', example='[{"Field":"TableSchema","Type":"Asc"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **10** (default)
*   **30**
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  Only data within the last 30 days can be queried.', example='2022-09-25T12:10:00Z'),
  tableName?: string(name='TableName', description='The name of the table.

>  If you leave this parameter empty, the number of accesses to all tables in the cluster on a date is returned.', example='CUSTOMER'),
}

model DescribeTableAccessCountResponseBody = {
  items?: [ 
    {
      accessCount?: string(name='AccessCount', description='The number of accesses to the table.', example='6'),
      instanceName?: string(name='InstanceName', description='The ID of the cluster to which the table belongs.', example='amv-2ze627uzpkh8a8****'),
      reportDate?: string(name='ReportDate', description='The date when the table was accessed.', example='2022-09-26'),
      tableName?: string(name='TableName', description='The name of the table.', example='CUSTOMER'),
      tableSchema?: string(name='TableSchema', description='The database to which the table belongs.', example='tpch'),
    }
  ](name='Items', description='The queried tables.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='6B7D627B-DA23-572D-AD71-256F64698B7D'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeTableAccessCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTableAccessCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of accesses to a table or all tables in an AnalyticDB for MySQL cluster on a date.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeTableAccessCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTableAccessCountResponse
 */
async function describeTableAccessCountWithOptions(request: DescribeTableAccessCountRequest, runtime: Util.RuntimeOptions): DescribeTableAccessCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTableAccessCount',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of accesses to a table or all tables in an AnalyticDB for MySQL cluster on a date.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DescribeTableAccessCountRequest
 * @return DescribeTableAccessCountResponse
 */
async function describeTableAccessCount(request: DescribeTableAccessCountRequest): DescribeTableAccessCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTableAccessCountWithOptions(request, runtime);
}

model DescribeTableDetailRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model DescribeTableDetailResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The detailed reason why the access was denied.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  avgSize?: string(name='AvgSize', description='The average number of rows in a shard.', example='160'),
  items?: {
    shard?: [ 
      {
        id?: int32(name='Id', description='The shard ID. Only the numeric part of the shard name is returned.', example='1'),
        size?: long(name='Size', description='The number of rows in the table.', example='9484858'),
      }
    ](name='Shard', description='The queried shards.'),
  }(name='Items', description='The queried data distribution.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='9'),
}

model DescribeTableDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTableDetailResponseBody(name='body'),
}

/**
 * @summary Queries the information about data distribution among shards of a table.
 *
 * @param request DescribeTableDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTableDetailResponse
 */
async function describeTableDetailWithOptions(request: DescribeTableDetailRequest, runtime: Util.RuntimeOptions): DescribeTableDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTableDetail',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about data distribution among shards of a table.
 *
 * @param request DescribeTableDetailRequest
 * @return DescribeTableDetailResponse
 */
async function describeTableDetail(request: DescribeTableDetailRequest): DescribeTableDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTableDetailWithOptions(request, runtime);
}

model DescribeTablePartitionDiagnoseRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp171g24yvbxxxxx'),
  lang?: string(name='Lang', description='The language of the content within the request and response. Default value: **zh**. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON string format. Example: `[{"Field":"TotalSize","Type":"Desc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `SchemaName`: the name of the database to which the table belongs.
    *   `TableName`: the name of the table.
    *   `TotalSize`: the total data size of the table.
    *   `SpaceRatio`: the storage percentage of the table.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, the query results are sorted by the TotalSize field in descending order.', example='[{\\\\"Field\\\\":\\\\"TotalSize\\\\",\\\\"Type\\\\":\\\\"Desc\\\\"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DescribeTablePartitionDiagnoseResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-bp171g24yvbxxxxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The detection result.', example='Multiple oversized non-partitioned tables are detected.'),
      name?: string(name='Name', description='The name of the detection item.', example='Improper partition field diagnostics'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  items?: [ 
    {
      partitionDetail?: string(name='PartitionDetail', description='The improper partitions.', example='[20210110, 20210113,20210123]'),
      partitionNumber?: int32(name='PartitionNumber', description='The number of partitions.', example='2'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='test_db'),
      spaceRatio?: double(name='SpaceRatio', description='The storage percentage of the table. Unit: %.

>  Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.', example='66.23'),
      tableName?: string(name='TableName', description='The name of the table.', example='user'),
      totalSize?: long(name='TotalSize', description='The total data size of the table. Unit: bytes.', example='42949672960'),
    }
  ](name='Items', description='The queried partition diagnostic information.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  suggestMaxRecordsPerPartition?: long(name='SuggestMaxRecordsPerPartition', description='The recommended maximum number of rows in each partition.', example='640000000'),
  suggestMinRecordsPerPartition?: long(name='SuggestMinRecordsPerPartition', description='The recommended minimum number of rows in each partition.', example='64000000'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='185'),
}

model DescribeTablePartitionDiagnoseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTablePartitionDiagnoseResponseBody(name='body'),
}

/**
 * @summary Queries the information about partition diagnostics.
 *
 * @param request DescribeTablePartitionDiagnoseRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTablePartitionDiagnoseResponse
 */
async function describeTablePartitionDiagnoseWithOptions(request: DescribeTablePartitionDiagnoseRequest, runtime: Util.RuntimeOptions): DescribeTablePartitionDiagnoseResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTablePartitionDiagnose',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about partition diagnostics.
 *
 * @param request DescribeTablePartitionDiagnoseRequest
 * @return DescribeTablePartitionDiagnoseResponse
 */
async function describeTablePartitionDiagnose(request: DescribeTablePartitionDiagnoseRequest): DescribeTablePartitionDiagnoseResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTablePartitionDiagnoseWithOptions(request, runtime);
}

model DescribeTablesRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1xxxxxxxx47'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
}

model DescribeTablesResponseBody = {
  items?: {
    table?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp1xxxxxxxx47'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
    }
  ](name='Table')
  }(name='Items', description='The queried tables.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTablesResponseBody(name='body'),
}

/**
 * @summary Queries a list of tables in a database.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTablesResponse
 */
async function describeTablesWithOptions(request: DescribeTablesRequest, runtime: Util.RuntimeOptions): DescribeTablesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTables',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of tables in a database.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request DescribeTablesRequest
 * @return DescribeTablesResponse
 */
async function describeTables(request: DescribeTablesRequest): DescribeTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTablesWithOptions(request, runtime);
}

model DescribeUserQuotaRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp1qjt3o18d86987'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model DescribeUserQuotaResponseBody = {
  elasticACU?: string(name='ElasticACU', description='The available elastic AnalyticDB compute units (ACUs).', example='512ACU'),
  requestId?: string(name='RequestId', description='The request ID.', example='0322C7FB-4584-5D2A-BF7F-F9036E940C35'),
  reserverdCompteACU?: string(name='ReserverdCompteACU', description='The available reserved computing resources.', example='48ACU'),
  reserverdStorageACU?: string(name='ReserverdStorageACU', description='The available reserved storage resources.', example='24ACU'),
  resourceGroupCount?: string(name='ResourceGroupCount', description='The number of available resource groups.', example='10'),
}

model DescribeUserQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserQuotaResponseBody(name='body'),
}

/**
 * @summary Queries available quotas.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeUserQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserQuotaResponse
 */
async function describeUserQuotaWithOptions(request: DescribeUserQuotaRequest, runtime: Util.RuntimeOptions): DescribeUserQuotaResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserQuota',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries available quotas.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeUserQuotaRequest
 * @return DescribeUserQuotaResponse
 */
async function describeUserQuota(request: DescribeUserQuotaRequest): DescribeUserQuotaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserQuotaWithOptions(request, runtime);
}

model DescribeWorkerDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-xxxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2024-04-25T02:04Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612293.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2021-11-18T00:00Z'),
}

model DescribeWorkerDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-xxxxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='There are a total of 10 tables with an excessive number of primary keys.'),
      name?: string(name='Name', description='The name of the detection item.', example='Metric detection'),
      results?: {
        operatorAgg?: [ 
          {
            metricName?: string(name='MetricName', description='The detection result items of operator metric aggregation.', example='Peak memory'),
            searchResults?: [ 
              {
                avgValue?: double(name='AvgValue', description='The average value of the operator metric.', example='2234'),
                maxValue?: long(name='MaxValue', description='The maximum value of the operator metric.', example='444'),
                operatorCount?: long(name='OperatorCount', description='The number of occurrences of the operator.', example='1234'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='Aggregation'),
                totalValue?: long(name='TotalValue', description='The cumulative value of the operator metric.', example='123'),
              }
            ](name='SearchResults', description='The detection result items of operator metric aggregation.'),
          }
        ](name='OperatorAgg', description='The detection result items of operator metric aggregation.'),
        operatorDetails?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='PeakMemory'),
            searchResults?: [ 
              {
                inputRows?: long(name='InputRows', description='The number of rows input by the operator.', example='123'),
                inputSize?: long(name='InputSize', description='The amount of data input by the operator. Unit: bytes.', example='123'),
                operatorCost?: long(name='OperatorCost', description='The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.', example='23'),
                operatorInfo?: string(name='OperatorInfo', description='The property information about the operator.', example='GROUP BY field: id'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='TableScan'),
                outputRows?: long(name='OutputRows', description='The number of rows output by the operator.', example='123'),
                outputSize?: long(name='OutputSize', description='The amount of data output by the operator. Unit: bytes.', example='123'),
                peakMemory?: long(name='PeakMemory', description='The peak memory. Unit: bytes.', example='23'),
                processId?: string(name='ProcessId', description='The query ID that can be used for diagnostics.', example='2024041909301402103302422803151411141'),
                stageId?: string(name='StageId', description='The stage ID.', example='Stage[2]'),
              }
            ](name='SearchResults', description='The detection result items of abnormal operators.'),
          }
        ](name='OperatorDetails', description='The detection result items of abnormal operators.'),
        partitionedTables?: [ 
          {
            DDL?: string(name='DDL', description='The SQL statement that is used to create the table.', example='create table test(id varchar)'),
            partitionCount?: string(name='PartitionCount', description='The number of partitions.', example='234'),
            partitionIds?: string(name='PartitionIds', description='The ID of the improper partition.', example='[2024,2025]'),
            schemaName?: string(name='SchemaName', description='The name of the database.', example='nxg'),
            tableName?: string(name='TableName', description='The name of the table.', example='zhw_place_order'),
            totalDataSize?: long(name='TotalDataSize', description='The total data size of the table.', example='1234'),
          }
        ](name='PartitionedTables', description='The detection result items of improper partitioned tables.'),
        skewedTables?: [ 
          {
            DDL?: string(name='DDL', description='The SQL statement that is used to create the table.', example='create table test(id varchar)'),
            partitionCount?: int32(name='PartitionCount', description='The number of partitions.', example='2'),
            schemaName?: string(name='SchemaName', description='The name of the database.', example='platfunc'),
            shardSkewedRows?: string(name='ShardSkewedRows', description='The number of skewed rows in the table.', example='1234'),
            tableName?: string(name='TableName', description='The name of the table.', example='sls_log_cheat_action'),
            totalDataSize?: long(name='TotalDataSize', description='The total data size of the table. Unit: bytes.', example='2345'),
            totalLocalDataSize?: string(name='TotalLocalDataSize', description='The size of hot data. Unit: bytes.', example='2345'),
            totalPkSize?: long(name='TotalPkSize', description='The data size of the primary key. Unit: bytes.', example='234'),
            totalRemoteDataSize?: long(name='TotalRemoteDataSize', description='The size of cold data. Unit: bytes.', example='234'),
            totalRowCount?: long(name='TotalRowCount', description='The number of rows in the table.', example='34'),
          }
        ](name='SkewedTables', description='The detection result items of skewed tables.'),
        topAccessTables?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='Peak memory detection'),
            searchResults?: [ 
              {
                accessCount?: long(name='AccessCount', description='The number of accesses to the table.', example='1111'),
                avgScanCost?: double(name='AvgScanCost', description='The average amount of time for scanning. Unit: milliseconds.', example='234'),
                avgScanSize?: double(name='AvgScanSize', description='The average data size for scanning. Unit: bytes.', example='234'),
                maxScanCost?: long(name='MaxScanCost', description='The maximum amount of time for scanning. Unit: milliseconds.', example='345'),
                maxScanSize?: long(name='MaxScanSize', description='The maximum data size for scanning. Unit: bytes.', example='2345'),
                tableName?: string(name='TableName', description='The name of the table.', example='tiberias_2copt_origin_order_goods_info'),
              }
            ](name='SearchResults', description='The detection result items of table access.'),
          }
        ](name='TopAccessTables', description='The detection result items of table access.'),
      }(name='Results', description='The detection result items.'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='E5B37B61-E6C9-5FE0-9374-45BAA548AEF6'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='20'),
}

model DescribeWorkerDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeWorkerDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic results of the storage layer.
 *
 * @param request DescribeWorkerDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWorkerDetectionResponse
 */
async function describeWorkerDetectionWithOptions(request: DescribeWorkerDetectionRequest, runtime: Util.RuntimeOptions): DescribeWorkerDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWorkerDetection',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic results of the storage layer.
 *
 * @param request DescribeWorkerDetectionRequest
 * @return DescribeWorkerDetectionResponse
 */
async function describeWorkerDetection(request: DescribeWorkerDetectionRequest): DescribeWorkerDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWorkerDetectionWithOptions(request, runtime);
}

model DetachUserENIRequest {
  DBClusterId?: string(name='DBClusterId', description='The instance ID.

This parameter is required.', example='am-bp11q28kvl688****'),
}

model DetachUserENIResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DetachUserENIResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachUserENIResponseBody(name='body'),
}

/**
 * @summary 解绑用户弹性网卡
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DetachUserENIRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachUserENIResponse
 */
async function detachUserENIWithOptions(request: DetachUserENIRequest, runtime: Util.RuntimeOptions): DetachUserENIResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachUserENI',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 解绑用户弹性网卡
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DetachUserENIRequest
 * @return DetachUserENIResponse
 */
async function detachUserENI(request: DetachUserENIRequest): DetachUserENIResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachUserENIWithOptions(request, runtime);
}

model DisableAdviceServiceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-uf67culrr26q2****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-shanghai'),
}

model DisableAdviceServiceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='57EC6CCA-A582-572C-A33D-F61845CBC03C'),
}

model DisableAdviceServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableAdviceServiceResponseBody(name='body'),
}

/**
 * @summary Disables the suggestion feature.
 *
 * @param request DisableAdviceServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableAdviceServiceResponse
 */
async function disableAdviceServiceWithOptions(request: DisableAdviceServiceRequest, runtime: Util.RuntimeOptions): DisableAdviceServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableAdviceService',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables the suggestion feature.
 *
 * @param request DisableAdviceServiceRequest
 * @return DisableAdviceServiceResponse
 */
async function disableAdviceService(request: DisableAdviceServiceRequest): DisableAdviceServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableAdviceServiceWithOptions(request, runtime);
}

model DisableElasticPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

>  You can call the [DescribeElasticPlans](https://help.aliyun.com/document_detail/601334.html) operation to query the names of scaling plans.

This parameter is required.', example='test'),
}

model DisableElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
}

model DisableElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableElasticPlanResponseBody(name='body'),
}

/**
 * @summary Disables a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DisableElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableElasticPlanResponse
 */
async function disableElasticPlanWithOptions(request: DisableElasticPlanRequest, runtime: Util.RuntimeOptions): DisableElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableElasticPlan',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DisableElasticPlanRequest
 * @return DisableElasticPlanResponse
 */
async function disableElasticPlan(request: DisableElasticPlanRequest): DisableElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableElasticPlanWithOptions(request, runtime);
}

model DownloadDiagnosisRecordsRequest {
  clientIp?: string(name='ClientIp', description='The source IP address.

>  You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='106.11.XX.XX'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='amv-bp1q8bu9a****'),
  database?: string(name='Database', description='The name of the database on which the SQL statements are executed.

>  You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.', example='1662450730000'),
  keyword?: string(name='Keyword', description='The query keyword of the SQL statements.', example='select'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  maxPeakMemory?: long(name='MaxPeakMemory', description='The maximum peak memory of the SQL statements. Unit: bytes.', example='88000000'),
  maxScanSize?: long(name='MaxScanSize', description='The maximum scan size of the SQL statements. Unit: bytes.', example='64424509440'),
  minPeakMemory?: long(name='MinPeakMemory', description='The minimum peak memory of the SQL statements. Unit: bytes.', example='88000000'),
  minScanSize?: long(name='MinScanSize', description='The minimum scan size of the SQL statements. Unit: bytes.', example='1073741824'),
  queryCondition?: string(name='QueryCondition', description='The query condition for SQL statements, which can contain the `Type`, `Value`, `Min`, and `Max` fields. Specify the condition in the JSON format. `Type` specifies the query dimension. Valid values for Type: `maxCost`, `status`, and `cost`. `Value`, `Min`, or `Max` specifies the query range for the dimension. Valid values:

*   `{"Type":"maxCost","Value":"100"}`: queries the top 100 most time-consuming SQL statements. Set `Value` to 100.
*   `{"Type":"status","Value":"finished"}`: queries the executed SQL statements. You can set `Value` to `running` to query the SQL statements that are being executed. You can also set Value to `failed` to query the SQL statements that failed to be executed.
*   `{"Type":"cost","Min":"10","Max":"200"}`: queries the SQL statements whose execution duration is in the range of 10 to 200 milliseconds. You can also specify custom values for the Min and Max fields.', example='{"Type":"status","Value":"finished"}'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The resource group to which the SQL statements belong.

>  You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='user_default'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

>  You can query data only within the last 14 days.', example='1662364330000'),
  userName?: string(name='UserName', description='The username that is used to execute the SQL statements.

>  You can call the [DescribeDiagnosisDimensions](~~~~) operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.', example='test_user'),
}

model DownloadDiagnosisRecordsResponseBody = {
  downloadId?: int32(name='DownloadId', description='The download ID.', example='25494'),
  requestId?: string(name='RequestId', description='The request ID.', example='845774AC-5D43-53A2-AAB8-C73828E68508'),
}

model DownloadDiagnosisRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DownloadDiagnosisRecordsResponseBody(name='body'),
}

/**
 * @summary Downloads the diagnostic information about SQL statements that meet a query condition for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DownloadDiagnosisRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DownloadDiagnosisRecordsResponse
 */
async function downloadDiagnosisRecordsWithOptions(request: DownloadDiagnosisRecordsRequest, runtime: Util.RuntimeOptions): DownloadDiagnosisRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientIp)) {
    query['ClientIp'] = request.clientIp;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.database)) {
    query['Database'] = request.database;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.maxPeakMemory)) {
    query['MaxPeakMemory'] = request.maxPeakMemory;
  }
  if (!Util.isUnset(request.maxScanSize)) {
    query['MaxScanSize'] = request.maxScanSize;
  }
  if (!Util.isUnset(request.minPeakMemory)) {
    query['MinPeakMemory'] = request.minPeakMemory;
  }
  if (!Util.isUnset(request.minScanSize)) {
    query['MinScanSize'] = request.minScanSize;
  }
  if (!Util.isUnset(request.queryCondition)) {
    query['QueryCondition'] = request.queryCondition;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    query['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DownloadDiagnosisRecords',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Downloads the diagnostic information about SQL statements that meet a query condition for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request DownloadDiagnosisRecordsRequest
 * @return DownloadDiagnosisRecordsResponse
 */
async function downloadDiagnosisRecords(request: DownloadDiagnosisRecordsRequest): DownloadDiagnosisRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return downloadDiagnosisRecordsWithOptions(request, runtime);
}

model DownloadInstanceCACertificateRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-wz9842849v6****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
  ownerId?: string(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model DownloadInstanceCACertificateResponseBody = {
  downloadUrl?: string(name='DownloadUrl', description='The OSS URL of the downloaded certificate.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9CCFAAB4-97B7-5800-B9F2-685EB596E3EF'),
}

model DownloadInstanceCACertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DownloadInstanceCACertificateResponseBody(name='body'),
}

/**
 * @summary Queries the Object Storage Service (OSS) URL of the downloaded certificate authority (CA) certificate that is used to connect to the wide table engine.
 *
 * @param request DownloadInstanceCACertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DownloadInstanceCACertificateResponse
 */
async function downloadInstanceCACertificateWithOptions(request: DownloadInstanceCACertificateRequest, runtime: Util.RuntimeOptions): DownloadInstanceCACertificateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DownloadInstanceCACertificate',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the Object Storage Service (OSS) URL of the downloaded certificate authority (CA) certificate that is used to connect to the wide table engine.
 *
 * @param request DownloadInstanceCACertificateRequest
 * @return DownloadInstanceCACertificateResponse
 */
async function downloadInstanceCACertificate(request: DownloadInstanceCACertificateRequest): DownloadInstanceCACertificateResponse {
  var runtime = new Util.RuntimeOptions{};
  return downloadInstanceCACertificateWithOptions(request, runtime);
}

model EnableAdviceServiceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp1q10xxzq2z4****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-shanghai'),
}

model EnableAdviceServiceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='E1745C03-7CCE-55CF-932E-08121AAFA6AF'),
}

model EnableAdviceServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableAdviceServiceResponseBody(name='body'),
}

/**
 * @summary Enables the suggestion feature.
 *
 * @param request EnableAdviceServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableAdviceServiceResponse
 */
async function enableAdviceServiceWithOptions(request: EnableAdviceServiceRequest, runtime: Util.RuntimeOptions): EnableAdviceServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableAdviceService',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables the suggestion feature.
 *
 * @param request EnableAdviceServiceRequest
 * @return EnableAdviceServiceResponse
 */
async function enableAdviceService(request: EnableAdviceServiceRequest): EnableAdviceServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableAdviceServiceWithOptions(request, runtime);
}

model EnableElasticPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

>  You can call the [DescribeElasticPlans](https://help.aliyun.com/document_detail/601334.html) operation to query the names of scaling plans.

This parameter is required.', example='test'),
}

model EnableElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
}

model EnableElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableElasticPlanResponseBody(name='body'),
}

/**
 * @summary Enables a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request EnableElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableElasticPlanResponse
 */
async function enableElasticPlanWithOptions(request: EnableElasticPlanRequest, runtime: Util.RuntimeOptions): EnableElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableElasticPlan',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request EnableElasticPlanRequest
 * @return EnableElasticPlanResponse
 */
async function enableElasticPlan(request: EnableElasticPlanRequest): EnableElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableElasticPlanWithOptions(request, runtime);
}

model ExecuteSparkReplStatementRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query Spark application IDs.', example='s202411071444hzdvk486d9d2001****'),
  code?: string(name='Code', description='The code that you want to execute.

This parameter is required.', example='print(1+1)'),
  codeType?: string(name='CodeType', description='The language type of the code. Valid values:

*   SCALA
*   PYTHON

This parameter is required.', example='PYTHON'),
  sessionId?: long(name='SessionId', description='The ID of the session that you want to use to execute the code.

This parameter is required.', example='123'),
}

model ExecuteSparkReplStatementResponseBody = {
  data?: {
    aliyunUid?: long(name='AliyunUid', description='The ID of the Alibaba Cloud account that owns the cluster.', example='17108278707****'),
    code?: string(name='Code', description='The code that is executed.', example='print(1+1)'),
    codeState?: string(name='CodeState', description='The code execution status. Valid values:

*   CANCELLED
*   RUNNING
*   SUCCEEDED
*   ERROR', example='RUNNING'),
    codeType?: string(name='CodeType', description='The code type. Valid values:

*   SCALA
*   PYTHON', example='PYTHON'),
    columns?: [ string ](name='Columns', description='The column names.'),
    endTime?: long(name='EndTime', description='The end time of the execution. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1730968125000'),
    error?: string(name='Error', description='The error message.', example='StackOverflow Exception'),
    output?: string(name='Output', description='The code execution result, which is a JSON string that conforms to Apache Livy.', example='{"text/plain": 2}'),
    outputType?: string(name='OutputType', description='The execution result type, which is in the JSON format. Valid values:

*   TEXT: the text content that conforms to Apache Livy.
*   TABLE: the table content that conforms to Apache Livy.', example='TEXT'),
    startTime?: long(name='StartTime', description='The start time of the execution. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1730968125000'),
    statementId?: long(name='StatementId', description='The unique ID of the code block in the Spark job.', example='123'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ExecuteSparkReplStatementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteSparkReplStatementResponseBody(name='body'),
}

/**
 * @summary Executes part of the code in a Spark job.
 *
 * @param request ExecuteSparkReplStatementRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteSparkReplStatementResponse
 */
async function executeSparkReplStatementWithOptions(request: ExecuteSparkReplStatementRequest, runtime: Util.RuntimeOptions): ExecuteSparkReplStatementResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.code)) {
    body['Code'] = request.code;
  }
  if (!Util.isUnset(request.codeType)) {
    body['CodeType'] = request.codeType;
  }
  if (!Util.isUnset(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteSparkReplStatement',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Executes part of the code in a Spark job.
 *
 * @param request ExecuteSparkReplStatementRequest
 * @return ExecuteSparkReplStatementResponse
 */
async function executeSparkReplStatement(request: ExecuteSparkReplStatementRequest): ExecuteSparkReplStatementResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeSparkReplStatementWithOptions(request, runtime);
}

model ExecuteSparkWarehouseBatchSQLRequest {
  agency?: string(name='Agency', description='The name of the client.', example='DataWorks'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp11q28kvl688****'),
  executeResultLimit?: long(name='ExecuteResultLimit', description='The maximum amount of execution result data that can be written to Object Storage Service (OSS). Unit: MB. Default value: 4096. The size of compressed objects is difficult to estimate. The data that is actually written to OSS is smaller than the specified value.', example='4096'),
  executeTimeLimitInSeconds?: long(name='ExecuteTimeLimitInSeconds', description='The maximum execution duration. Unit: seconds. If a set of SQL statements fail to be executed for the specified period of time after submission, they are marked as a timeout error. The default value is 360000 seconds, which is equivalent to 100 hours.', example='3600000'),
  query?: string(name='Query', description='The SQL statements that you want to execute in batches. Separate multiple SQL statements with semicolons (;). The execution engine executes the SQL statements in sequence in the same session.

This parameter is required.', example='CREATE TABLE user(id INT, name STRING);
INSERT INTO t VALUE(1, \\\\"Bob\\\\");
SELECT * FROM t;'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

This parameter is required.', example='test'),
  runtimeConfig?: string(name='RuntimeConfig', description='The additional runtime parameter. Specify the parameter in the JSON format.', example='{
 "OSSURL": "oss://testBucketname/"
}'),
  schema?: string(name='Schema', description='The name of the database.', example='adb_demo'),
}

model ExecuteSparkWarehouseBatchSQLResponseBody = {
  data?: SparkBatchSQL(name='Data', description='The returned data.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='CBE843D8-964D-5EA3-9D31-822125611B6E'),
}

model ExecuteSparkWarehouseBatchSQLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteSparkWarehouseBatchSQLResponseBody(name='body'),
}

/**
 * @summary Executes Spark SQL statements in batches.
 *
 * @param request ExecuteSparkWarehouseBatchSQLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteSparkWarehouseBatchSQLResponse
 */
async function executeSparkWarehouseBatchSQLWithOptions(request: ExecuteSparkWarehouseBatchSQLRequest, runtime: Util.RuntimeOptions): ExecuteSparkWarehouseBatchSQLResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.agency)) {
    body['Agency'] = request.agency;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.executeResultLimit)) {
    body['ExecuteResultLimit'] = request.executeResultLimit;
  }
  if (!Util.isUnset(request.executeTimeLimitInSeconds)) {
    body['ExecuteTimeLimitInSeconds'] = request.executeTimeLimitInSeconds;
  }
  if (!Util.isUnset(request.query)) {
    body['Query'] = request.query;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.runtimeConfig)) {
    body['RuntimeConfig'] = request.runtimeConfig;
  }
  if (!Util.isUnset(request.schema)) {
    body['Schema'] = request.schema;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteSparkWarehouseBatchSQL',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Executes Spark SQL statements in batches.
 *
 * @param request ExecuteSparkWarehouseBatchSQLRequest
 * @return ExecuteSparkWarehouseBatchSQLResponse
 */
async function executeSparkWarehouseBatchSQL(request: ExecuteSparkWarehouseBatchSQLRequest): ExecuteSparkWarehouseBatchSQLResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeSparkWarehouseBatchSQLWithOptions(request, runtime);
}

model ExistRunningSQLEngineRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='amv-bp1cit7z8j****'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the name of the resource group for a cluster.

This parameter is required.', example='spark_test'),
}

model ExistRunningSQLEngineResponseBody = {
  data?: boolean(name='Data', description='Indicates whether a running SQL engine exists in the resource group.

Valid values:

*   **True**
*   **False**', example='True'),
  requestId?: string(name='RequestId', description='The request ID.', example='FA675D68-14A4-5D9C-8820-92537D9F447E'),
}

model ExistRunningSQLEngineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExistRunningSQLEngineResponseBody(name='body'),
}

/**
 * @summary Queries whether a running SQL engine exists.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ExistRunningSQLEngineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExistRunningSQLEngineResponse
 */
async function existRunningSQLEngineWithOptions(request: ExistRunningSQLEngineRequest, runtime: Util.RuntimeOptions): ExistRunningSQLEngineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExistRunningSQLEngine',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether a running SQL engine exists.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ExistRunningSQLEngineRequest
 * @return ExistRunningSQLEngineResponse
 */
async function existRunningSQLEngine(request: ExistRunningSQLEngineRequest): ExistRunningSQLEngineResponse {
  var runtime = new Util.RuntimeOptions{};
  return existRunningSQLEngineWithOptions(request, runtime);
}

model GetApsManagedDatabasesRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

This parameter is required.', example='amv-******'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model GetApsManagedDatabasesResponseBody = {
  data?: string(name='Data', description='The returned data.', example='-'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model GetApsManagedDatabasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetApsManagedDatabasesResponseBody(name='body'),
}

/**
 * @summary Queries a list of databases.
 *
 * @param request GetApsManagedDatabasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetApsManagedDatabasesResponse
 */
async function getApsManagedDatabasesWithOptions(request: GetApsManagedDatabasesRequest, runtime: Util.RuntimeOptions): GetApsManagedDatabasesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetApsManagedDatabases',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of databases.
 *
 * @param request GetApsManagedDatabasesRequest
 * @return GetApsManagedDatabasesResponse
 */
async function getApsManagedDatabases(request: GetApsManagedDatabasesRequest): GetApsManagedDatabasesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getApsManagedDatabasesWithOptions(request, runtime);
}

model GetCreateTableSQLRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-2ze8mbuai974s4y2'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model GetCreateTableSQLResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='109462AF-B5FA-3D5A-9377-B27E5B******'),
  SQL?: string(name='SQL', description='The SQL statement.', example='create table (
 id varchar(32)
);'),
}

model GetCreateTableSQLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCreateTableSQLResponseBody(name='body'),
}

/**
 * @summary Queries the table creation statement for tables.
 *
 * @param request GetCreateTableSQLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCreateTableSQLResponse
 */
async function getCreateTableSQLWithOptions(request: GetCreateTableSQLRequest, runtime: Util.RuntimeOptions): GetCreateTableSQLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCreateTableSQL',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the table creation statement for tables.
 *
 * @param request GetCreateTableSQLRequest
 * @return GetCreateTableSQLResponse
 */
async function getCreateTableSQL(request: GetCreateTableSQLRequest): GetCreateTableSQLResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreateTableSQLWithOptions(request, runtime);
}

model GetDatabaseObjectsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1565u55p32****'),
  filterOwner?: string(name='FilterOwner', description='The owner of the database.', example='admin'),
  filterSchemaName?: string(name='FilterSchemaName', description='The name of the database.', example='test_db'),
  orderBy?: string(name='OrderBy', description='The order in which you want to sort the query results. Valid values:

*   Asc
*   Desc

Valid values for Field: DatabaseName, CreateTime, and UpdateTime. -CreateTime; -UpdateTime;

Default value: {"Type": "Desc","Field": "DatabaseName"}.', example='{"Type": "Desc","Field": "DbName"}'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the database.

This parameter is required.', example='cn-hangzhou'),
}

model GetDatabaseObjectsResponseBody = {
  data?: {
    databaseSummaryModels?: [
      DatabaseSummaryModel
    ](name='DatabaseSummaryModels', description='The queried database.'),
    pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
  }(name='Data', description='The queried databases.'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='863D51B7-5321-41D8-A0B6-A088B0******'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model GetDatabaseObjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDatabaseObjectsResponseBody(name='body'),
}

/**
 * @summary Queries the information about databases.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetDatabaseObjectsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDatabaseObjectsResponse
 */
async function getDatabaseObjectsWithOptions(request: GetDatabaseObjectsRequest, runtime: Util.RuntimeOptions): GetDatabaseObjectsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.filterOwner)) {
    query['FilterOwner'] = request.filterOwner;
  }
  if (!Util.isUnset(request.filterSchemaName)) {
    query['FilterSchemaName'] = request.filterSchemaName;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDatabaseObjects',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about databases.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetDatabaseObjectsRequest
 * @return GetDatabaseObjectsResponse
 */
async function getDatabaseObjects(request: GetDatabaseObjectsRequest): GetDatabaseObjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDatabaseObjectsWithOptions(request, runtime);
}

model GetLakeStorageRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-*******'),
  lakeStorageId?: string(name='LakeStorageId', description='The lake storage ID.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model GetLakeStorageResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='200'),
  data?: {
    createTime?: string(name='CreateTime', description='The time when the lake storage was created.', example='2023-05-15T07:24:58Z'),
    creatorUid?: string(name='CreatorUid', description='The creator UID.', example='123456'),
    DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.', example='amv-*******'),
    description?: string(name='Description', description='The description of the lake storage.', example='a test db'),
    fileSize?: string(name='FileSize', description='The total storage size.', example='1'),
    lakeStorageId?: string(name='LakeStorageId', description='The unique identifier of the lake storage.', example='-'),
    operatorUid?: string(name='OperatorUid', description='The operator UID.', example='123456'),
    ownerUid?: string(name='OwnerUid', description='The owner UID.', example='123456'),
    partitionCount?: string(name='PartitionCount', description='The number of partitions.', example='-'),
    permissions?: [ 
      {
        account?: string(name='Account', description='The account ID.', example='test'),
        read?: boolean(name='Read', description='The read permissions.', example='true'),
        type?: string(name='Type', description='The account type.', example='-'),
        write?: boolean(name='Write', description='The write permissions.', example='true'),
      }
    ](name='Permissions', description='The permissions on the lake storage.', example='-'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    rowCount?: long(name='RowCount', description='The total number of entries returned.', example='-'),
    tableCount?: int32(name='TableCount', description='The number of the tables.', example='-'),
    updateTime?: string(name='UpdateTime', description='The time when the lake storage was last updated.', example='2024-10-14T02:28:41Z'),
  }(name='Data', description='The queried lake storage.', example='-'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model GetLakeStorageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLakeStorageResponseBody(name='body'),
}

/**
 * @summary Queries a lake storage.
 *
 * @param request GetLakeStorageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLakeStorageResponse
 */
async function getLakeStorageWithOptions(request: GetLakeStorageRequest, runtime: Util.RuntimeOptions): GetLakeStorageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lakeStorageId)) {
    query['LakeStorageId'] = request.lakeStorageId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetLakeStorage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a lake storage.
 *
 * @param request GetLakeStorageRequest
 * @return GetLakeStorageResponse
 */
async function getLakeStorage(request: GetLakeStorageRequest): GetLakeStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getLakeStorageWithOptions(request, runtime);
}

model GetSparkAppAttemptLogRequest {
  attemptId?: string(name='AttemptId', description='The ID of the log.

> You can call the [ListSparkAppAttempts](https://help.aliyun.com/document_detail/455887.html) operation to query the information about the retry attempts of a Spark application, including the retry log IDs.

This parameter is required.', example='s202207151211hz****-0001'),
  logLength?: long(name='LogLength', description='The number of log entries to return. Valid values: 1 to 500. Default value: 300.', example='20'),
  pageNumber?: int32(name='PageNumber', description='The log offset.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='500'),
}

model GetSparkAppAttemptLogResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The application ID.', example='s202204132018hzprec1ac61a000****'),
    DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-clusterxxx'),
    logContent?: string(name='LogContent', description='The content of the log.', example='22/04/22 15:30:49 INFO Utils: Start the dump task because s202207151211hz****-0001 app end, the interval is 238141ms;22/04/22 15:30:49 INFO AbstractConnector: Stopped Spark@5e774d9d{HTTP/1.1, (http/1.1)}{0.0.0.0:4040}'),
    logSize?: int32(name='LogSize', description='The number of log entries. A value of 0 indicates that no valid logs are returned.', example='775946240'),
    message?: string(name='Message', description='The alert message returned for the request, such as task execution failure or insufficient resources. If no alert occurs, null is returned.', example='WARNING: log file maybe deleted, please check oss path: oss://TestBucketName/applog/'),
  }(name='Data', description='The queried log.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C3A9594F-1D40-4472-A96C-8FB8AA20D38C'),
}

model GetSparkAppAttemptLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkAppAttemptLogResponseBody(name='body'),
}

/**
 * @summary Queries the information about the retry log of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppAttemptLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkAppAttemptLogResponse
 */
async function getSparkAppAttemptLogWithOptions(request: GetSparkAppAttemptLogRequest, runtime: Util.RuntimeOptions): GetSparkAppAttemptLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.attemptId)) {
    body['AttemptId'] = request.attemptId;
  }
  if (!Util.isUnset(request.logLength)) {
    body['LogLength'] = request.logLength;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkAppAttemptLog',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the retry log of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppAttemptLogRequest
 * @return GetSparkAppAttemptLogResponse
 */
async function getSparkAppAttemptLog(request: GetSparkAppAttemptLogRequest): GetSparkAppAttemptLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkAppAttemptLogWithOptions(request, runtime);
}

model GetSparkAppInfoRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query the Spark application IDs.

This parameter is required.', example='s202205201533hz1209892000****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.', example='am-bp11q28kvl688****'),
}

model GetSparkAppInfoResponseBody = {
  data?: SparkAppInfo(name='Data', description='The queried Spark application. Fields in the response parameter:

*   **Data**: the data of the Spark application template.
*   **EstimateExecutionCpuTimeInSeconds**: the amount of time that is required to consume CPU resources for running the Spark application. Unit: milliseconds.
*   **LogRootPath**: the storage path of log files.
*   **LastAttemptId**: the most recent attempt ID.
*   **WebUiAddress**: the web UI URL.
*   **SubmittedTimeInMillis**: the time when the Spark application was submitted. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.
*   **StartedTimeInMillis**: the time when the Spark application was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.
*   **LastUpdatedTimeInMillis**: the time when the Spark application was last updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.
*   **TerminatedTimeInMillis**: the time when the Spark application was terminated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.
*   **DBClusterId**: the ID of the cluster on which the Spark application runs.
*   **ResourceGroupName**: the name of the job resource group.
*   **DurationInMillis**: the amount of time that is required to run the Spark application. Unit: milliseconds.', example='{     \\\\"name\\\\": \\\\"SparkPi\\\\",     \\\\"file\\\\": \\\\"local:///tmp/spark-examples.jar\\\\",     \\\\"className\\\\": \\\\"org.apache.spark.examples.SparkPi\\\\",     \\\\"args\\\\": [         \\\\"1000000\\\\"     ],     \\\\"conf\\\\": {         \\\\"spark.driver.resourceSpec\\\\": \\\\"small\\\\",         \\\\"spark.executor.instances\\\\": 1,         \\\\"spark.executor.resourceSpec\\\\": \\\\"small\\\\"     } }",
      "EstimateExecutionCpuTimeInSeconds" : 100,
      "LogRootPath" : "oss://test/logs/driver",
      "LastAttemptId" : "s202204291426hzpre60cfabb0000004-0003",
      "WebUiAddress" : "https://sparkui.aliyuncs.com/token=xxx",
      "SubmittedTimeInMillis" : 1651213645000,
      "StartedTimeInMillis" : 1651213645010,
      "LastUpdatedTimeInMillis" : 1651213645200,
      "TerminatedTimeInMillis" : 1651213645300,
      "DBClusterId" : "am-dbclusterid",
      "ResourceGroupName" : "spark-rg",
      "DurationInMillis" : 100
    }'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model GetSparkAppInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkAppInfoResponseBody(name='body'),
}

/**
 * @summary Queries the information about an Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkAppInfoResponse
 */
async function getSparkAppInfoWithOptions(request: GetSparkAppInfoRequest, runtime: Util.RuntimeOptions): GetSparkAppInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkAppInfo',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppInfoRequest
 * @return GetSparkAppInfoResponse
 */
async function getSparkAppInfo(request: GetSparkAppInfoRequest): GetSparkAppInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkAppInfoWithOptions(request, runtime);
}

model GetSparkAppLogRequest {
  appId?: string(name='AppId', description='The Spark application ID.

> You can call the [ListSparkApps](https://help.aliyun.com/document_detail/612475.html) operation to query the Spark application ID.

This parameter is required.', example='s202206061441hz22a35ab000****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.', example='amv-2ze6fl8ud7t***'),
  logLength?: long(name='LogLength', description='The number of log entries to return. Valid values: 1 to 500. Default value: 300.', example='20'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='500'),
}

model GetSparkAppLogResponseBody = {
  data?: {
    DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-clusterxxx'),
    logContent?: string(name='LogContent', description='The content of the log.', example='22/04/22 15:30:49 INFO Utils: Start the dump task because s202206061441hz22a35ab000****-0001 app end, the interval is 238141ms;22/04/22 15:30:49 INFO AbstractConnector: Stopped Spark@5e774d9d{HTTP/1.1, (http/1.1)}{0.0.0.0:4040}'),
    logSize?: int32(name='LogSize', description='The number of log entries. A value of 0 indicates that no valid logs are returned.', example='3517972480'),
    message?: string(name='Message', description='The alert message returned for the request, such as task execution failure or insufficient resources. If no alert occurs, null is returned.', example='WARNING:  log file maybe deleted, please check oss path: oss://TestBucketName/applog/'),
  }(name='Data', description='The queried log.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C3A9594F-1D40-4472-A96C-8FB8AA20D38C'),
}

model GetSparkAppLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkAppLogResponseBody(name='body'),
}

/**
 * @summary Queries the logs of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkAppLogResponse
 */
async function getSparkAppLogWithOptions(request: GetSparkAppLogRequest, runtime: Util.RuntimeOptions): GetSparkAppLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.logLength)) {
    body['LogLength'] = request.logLength;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkAppLog',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the logs of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppLogRequest
 * @return GetSparkAppLogResponse
 */
async function getSparkAppLog(request: GetSparkAppLogRequest): GetSparkAppLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkAppLogWithOptions(request, runtime);
}

model GetSparkAppMetricsRequest {
  appId?: string(name='AppId', description='The ID of the Spark application.

This parameter is required.', example='s202204221525hzca7d8140000003'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.', example='amv-bp1ggnu61d77****'),
}

model GetSparkAppMetricsResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The ID of the Spark application.', example='s202302051515shfa865f80003691'),
    attemptId?: string(name='AttemptId', description='The attempt ID of the Spark application.', example='s202301061000hz57d797b0000201-0001'),
    eventLogPath?: string(name='EventLogPath', description='The path of the event log.', example='oss://path/to/eventLog'),
    finished?: boolean(name='Finished', description='Indicates whether parsing is complete. Valid values:

*   true
*   false', example='True'),
    scanMetrics?: {
      outputRowsCount?: long(name='OutputRowsCount', description='The number of scanned rows.', example='1000'),
      totalReadFileSizeInByte?: long(name='TotalReadFileSizeInByte', description='The number of scanned bytes.', example='10000'),
    }(name='ScanMetrics', description='The metrics.'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model GetSparkAppMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkAppMetricsResponseBody(name='body'),
}

/**
 * @summary Queries the metrics of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppMetricsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkAppMetricsResponse
 */
async function getSparkAppMetricsWithOptions(request: GetSparkAppMetricsRequest, runtime: Util.RuntimeOptions): GetSparkAppMetricsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkAppMetrics',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the metrics of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppMetricsRequest
 * @return GetSparkAppMetricsResponse
 */
async function getSparkAppMetrics(request: GetSparkAppMetricsRequest): GetSparkAppMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkAppMetricsWithOptions(request, runtime);
}

model GetSparkAppStateRequest {
  appId?: string(name='AppId', description='The Spark application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query Spark application IDs.

This parameter is required.', example='s202204191546hzpread6a896000****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.', example='amv-bp1h405854m****'),
}

model GetSparkAppStateResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The Spark application ID.', example='s202204191546hzpread6a896000****'),
    appName?: string(name='AppName', description='The name of the application.', example='test'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-clusterxxx'),
    message?: string(name='Message', description='The alert message returned for the operation, such as task execution failure or insufficient resources. If no alert occurs, null is returned.', example='Insufficient resources.'),
    state?: string(name='State', description='The execution state of the application. Valid values:

*   **SUBMITTED**
*   **STARTING**
*   **RUNNING**
*   **FAILING**
*   **FAILED**
*   **KILLING**
*   **KILLED**
*   **SUCCEEDING**
*   **COMPLETED**
*   **FATAL**
*   **UNKNOWN**', example='COMPLETED'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model GetSparkAppStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkAppStateResponseBody(name='body'),
}

/**
 * @summary Queries the status of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkAppStateResponse
 */
async function getSparkAppStateWithOptions(request: GetSparkAppStateRequest, runtime: Util.RuntimeOptions): GetSparkAppStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkAppState',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkAppStateRequest
 * @return GetSparkAppStateResponse
 */
async function getSparkAppState(request: GetSparkAppStateRequest): GetSparkAppStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkAppStateWithOptions(request, runtime);
}

model GetSparkAppWebUiAddressRequest {
  appId?: string(name='AppId', description='The Spark application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query Spark application IDs.

This parameter is required.', example='s202205201533hz1209892000****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.', example='amv-uf6g8w25jacm7****'),
}

model GetSparkAppWebUiAddressResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The Spark application ID.', example='s202205201533hz1209892000****'),
    DBClusterId?: string(name='DBClusterId', description='The database ID.', example='amv-clusterxxx'),
    expirationTimeInMillis?: long(name='ExpirationTimeInMillis', description='The expiration time. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1655801973000'),
    webUiAddress?: string(name='WebUiAddress', description='The URL of the web UI for the Spark application.', example='https://adbsparkui-cn-hangzhou.aliyuncs.com/?token=****'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model GetSparkAppWebUiAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkAppWebUiAddressResponseBody(name='body'),
}

/**
 * @summary Queries the URL of the web UI for a Spark application.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetSparkAppWebUiAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkAppWebUiAddressResponse
 */
async function getSparkAppWebUiAddressWithOptions(request: GetSparkAppWebUiAddressRequest, runtime: Util.RuntimeOptions): GetSparkAppWebUiAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkAppWebUiAddress',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the URL of the web UI for a Spark application.
 *
 * @description *   General endpoint: `adb.aliyuncs.com`.
 * *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetSparkAppWebUiAddressRequest
 * @return GetSparkAppWebUiAddressResponse
 */
async function getSparkAppWebUiAddress(request: GetSparkAppWebUiAddressRequest): GetSparkAppWebUiAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkAppWebUiAddressWithOptions(request, runtime);
}

model GetSparkConfigLogPathRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='am-adsdxxxx'),
}

model GetSparkConfigLogPathResponseBody = {
  data?: {
    defaultLogPath?: string(name='DefaultLogPath', description='The default log path.', example='oss://aliyun-oa-adb-spark-1111-oss-cn-hanghzou/spark-logs'),
    isLogPathExists?: boolean(name='IsLogPathExists', description='Indicates whether a log path exists.', example='true'),
    modifiedTimestamp?: string(name='ModifiedTimestamp', description='The last modification time.', example='1675654361000'),
    modifiedUid?: string(name='ModifiedUid', description='The account ID of the modifier.', example='10130223128xxx'),
    recordedLogPath?: string(name='RecordedLogPath', description='The recorded log path.', example='oss://test/spark-logs/'),
  }(name='Data', description='The queried Spark log configuration.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1919-xxx-ssdfsdff'),
}

model GetSparkConfigLogPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkConfigLogPathResponseBody(name='body'),
}

/**
 * @summary Queries the Spark log configuration of an AnalyticDB for MySQL cluster, including the default Spark log path.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkConfigLogPathRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkConfigLogPathResponse
 */
async function getSparkConfigLogPathWithOptions(request: GetSparkConfigLogPathRequest, runtime: Util.RuntimeOptions): GetSparkConfigLogPathResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkConfigLogPath',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the Spark log configuration of an AnalyticDB for MySQL cluster, including the default Spark log path.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkConfigLogPathRequest
 * @return GetSparkConfigLogPathResponse
 */
async function getSparkConfigLogPath(request: GetSparkConfigLogPathRequest): GetSparkConfigLogPathResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkConfigLogPathWithOptions(request, runtime);
}

model GetSparkLogAnalyzeTaskRequest {
  taskId?: long(name='TaskId', description='The ID of the Spark log analysis task. You can call the ListSparkLogAnalyzeTasks operation to query the IDs of all Spark log analysis tasks that are submitted in the current cluster.

This parameter is required.', example='12'),
}

model GetSparkLogAnalyzeTaskResponseBody = {
  data?: SparkAnalyzeLogTask(name='Data', description='The information about the Spark log analysis task.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1DF5AF5B-C803-1861-A0FF-63666A557709'),
}

model GetSparkLogAnalyzeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkLogAnalyzeTaskResponseBody(name='body'),
}

/**
 * @summary Queries the results of a Spark log analysis task.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkLogAnalyzeTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkLogAnalyzeTaskResponse
 */
async function getSparkLogAnalyzeTaskWithOptions(request: GetSparkLogAnalyzeTaskRequest, runtime: Util.RuntimeOptions): GetSparkLogAnalyzeTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkLogAnalyzeTask',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the results of a Spark log analysis task.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkLogAnalyzeTaskRequest
 * @return GetSparkLogAnalyzeTaskResponse
 */
async function getSparkLogAnalyzeTask(request: GetSparkLogAnalyzeTaskRequest): GetSparkLogAnalyzeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkLogAnalyzeTaskWithOptions(request, runtime);
}

model GetSparkReplSessionRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query all application IDs.', example='s202411071444hzdvk486d9d200****'),
  sessionId?: long(name='SessionId', description='The ID of the session that executes the code.

This parameter is required.', example='1'),
}

model GetSparkReplSessionResponseBody = {
  data?: {
    active?: string(name='Active', description='Indicates whether the session is active. Valid values:

*   true
*   false', example='true'),
    aliyunUid?: string(name='AliyunUid', description='The ID of the Alibaba Cloud account that owns the cluster.', example='178157466101****'),
    attemptId?: string(name='AttemptId', description='The attempt ID of the Spark application.', example='s202301061000hz57d797b00002****'),
    error?: string(name='Error', description='The error message.', example='Session timed out'),
    sessionId?: long(name='SessionId', description='The ID of the session that executes the code.', example='1'),
    state?: string(name='State', description='The status of the session. Valid values:

*   IDLE
*   BUSY
*   DEAD', example='IDEL'),
    webUiAddress?: string(name='WebUiAddress', description='The URL of the web UI for the Spark application.', example='https://adbsparkui-cn-hangzhou.aliyuncs.com/?token=****'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4CE6DF97-AEA4-484F-906F-C407EE3770EB'),
}

model GetSparkReplSessionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkReplSessionResponseBody(name='body'),
}

/**
 * @summary Queries the status of a Spark session.
 *
 * @param request GetSparkReplSessionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkReplSessionResponse
 */
async function getSparkReplSessionWithOptions(request: GetSparkReplSessionRequest, runtime: Util.RuntimeOptions): GetSparkReplSessionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkReplSession',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of a Spark session.
 *
 * @param request GetSparkReplSessionRequest
 * @return GetSparkReplSessionResponse
 */
async function getSparkReplSession(request: GetSparkReplSessionRequest): GetSparkReplSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkReplSessionWithOptions(request, runtime);
}

model GetSparkReplStatementRequest {
  appId?: string(name='AppId', description='The application ID.

>  You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query Spark application IDs.', example='s202411071444hzdvk486d9d200****'),
  sessionId?: long(name='SessionId', description='The ID of the session that executes the code.', example='1'),
  statementId?: long(name='StatementId', description='The unique ID of the code block in the Spark job.', example='123'),
}

model GetSparkReplStatementResponseBody = {
  data?: {
    aliyunUid?: long(name='AliyunUid', description='The ID of the Alibaba Cloud account that owns the cluster.', example='144740799645****'),
    code?: string(name='Code', description='The code that is executed.', example='print(1+1)'),
    codeState?: string(name='CodeState', description='The code execution status. Valid values:

*   CANCELLED
*   RUNNING
*   SUCCEEDED
*   ERROR', example='RUNNING'),
    codeType?: string(name='CodeType', description='The code type. Valid values:

*   PYTHON
*   SCALA', example='PYTHON'),
    columns?: [ string ](name='Columns', description='The column names.'),
    endTime?: long(name='EndTime', description='The end time of the query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1730968194000'),
    error?: string(name='Error', description='The error message.', example='stackoverflow error'),
    output?: string(name='Output', description='The code execution result, which is a JSON string.', example='{"text/plain": 2}'),
    outputType?: string(name='OutputType', description='The execution result type.

Valid values:

*   TABLE
*   TEXT', example='TEXT'),
    startTime?: long(name='StartTime', description='The start time of the query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1730968194000'),
    statementId?: long(name='StatementId', description='The unique ID of the code block in the Spark job.', example='123'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model GetSparkReplStatementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkReplStatementResponseBody(name='body'),
}

/**
 * @summary Queries the execution result of a code block.
 *
 * @param request GetSparkReplStatementRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkReplStatementResponse
 */
async function getSparkReplStatementWithOptions(request: GetSparkReplStatementRequest, runtime: Util.RuntimeOptions): GetSparkReplStatementResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.statementId)) {
    body['StatementId'] = request.statementId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkReplStatement',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution result of a code block.
 *
 * @param request GetSparkReplStatementRequest
 * @return GetSparkReplStatementResponse
 */
async function getSparkReplStatement(request: GetSparkReplStatementRequest): GetSparkReplStatementResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkReplStatementWithOptions(request, runtime);
}

model GetSparkSQLEngineStateRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the job resource group.

This parameter is required.', example='test_instance'),
}

model GetSparkSQLEngineStateResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The ID of the Spark application.', example='s202207151211hz0c****'),
    config?: string(name='Config', description='The configuration of the Spark application.', example='{"key1": "value1", "key2": "value2"}'),
    jars?: string(name='Jars', description='The third-party JAR package.', example='oss://test-bucket/test.jar'),
    maxExecutor?: string(name='MaxExecutor', description='The maximum number of started Spark executors.', example='3'),
    minExecutor?: string(name='MinExecutor', description='The minimum number of started Spark executors.', example='1'),
    slotNum?: string(name='SlotNum', description='The slot number of the Spark application.', example='2'),
    state?: string(name='State', description='The execution state of the application. Valid values:

*   SUBMITTED
*   STARTING
*   RUNNING
*   FAILING
*   FAILED
*   KILLING
*   KILLED
*   SUCCEEDING
*   COMPLETED
*   FATAL
*   UNKNOWN', example='COMPLETED'),
    submittedTimeInMillis?: string(name='SubmittedTimeInMillis', description='The timestamp when the Spark SQL application was submitted. Unit: milliseconds.', example='1651213645000'),
  }(name='Data', description='The state information about the Spark SQL engine.'),
  requestId?: string(name='RequestId', description='The request ID.', example='xxxx-xxx-xx'),
}

model GetSparkSQLEngineStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkSQLEngineStateResponseBody(name='body'),
}

/**
 * @summary Queries the state information about the Spark SQL engine.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkSQLEngineStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkSQLEngineStateResponse
 */
async function getSparkSQLEngineStateWithOptions(request: GetSparkSQLEngineStateRequest, runtime: Util.RuntimeOptions): GetSparkSQLEngineStateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkSQLEngineState',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the state information about the Spark SQL engine.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkSQLEngineStateRequest
 * @return GetSparkSQLEngineStateResponse
 */
async function getSparkSQLEngineState(request: GetSparkSQLEngineStateRequest): GetSparkSQLEngineStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkSQLEngineStateWithOptions(request, runtime);
}

model GetSparkTemplateFileContentRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-8vbn8pq537k8w****'),
  id?: long(name='Id', description='The application template ID.

>  You can call the [GetSparkTemplateFullTree](https://help.aliyun.com/document_detail/456205.html) operation to query the application template ID.

This parameter is required.', example='725204'),
}

model GetSparkTemplateFileContentResponseBody = {
  data?: {
    appType?: string(name='AppType', description='The application type. Valid values:

*   **SQL**
*   **STREAMING**
*   **BATCH**', example='SQL'),
    content?: string(name='Content', description='The content of the application template.', example='set spark.driver.resourceSpec=medium;set spark.executor.instances=2;set spark.executor.resourceSpec=medium;set spark.app.name=Spark SQL Test;'),
    id?: long(name='Id', description='The application template ID.', example='725204'),
    resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.', example='test'),
    type?: string(name='Type', description='The file type. Valid values:

*   **folder**
*   **file**', example='file'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model GetSparkTemplateFileContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkTemplateFileContentResponseBody(name='body'),
}

/**
 * @summary Queries the content of a Spark application template.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkTemplateFileContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkTemplateFileContentResponse
 */
async function getSparkTemplateFileContentWithOptions(request: GetSparkTemplateFileContentRequest, runtime: Util.RuntimeOptions): GetSparkTemplateFileContentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkTemplateFileContent',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the content of a Spark application template.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkTemplateFileContentRequest
 * @return GetSparkTemplateFileContentResponse
 */
async function getSparkTemplateFileContent(request: GetSparkTemplateFileContentRequest): GetSparkTemplateFileContentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkTemplateFileContentWithOptions(request, runtime);
}

model GetSparkTemplateFolderTreeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
}

model GetSparkTemplateFolderTreeResponseBody = {
  data?: string(name='Data', description='The directory structure of Spark applications, which is in the tree format. Fields in the response parameter:

*   **Uid**: the UID of the Alibaba Cloud account.

*   **Type**: the application template type. Valid values: **FOLDER**

*   **Parent**: indicates whether a child directory exists. Valid values:

    *   **0**: no.
    *   **-1**: yes.

*   **Children**: the child directory.

*   **LastModified**: the time when applications in the directory are last modified. This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

*   **Name**: the name of the directory.

*   **Id**: the directory ID.', example='{           "Uid":195813423****,           "Type":"FOLDER",          "Parent":-1,           "Children":[              {                     "LastModified":1647853173,               "Uid":195813423****,                     "Type":"FOLDER",                     "Parent":0,                     "Id":157,                     "Name":"t"         }       ],            "Id":725204,            "Name":"root"      }'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model GetSparkTemplateFolderTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkTemplateFolderTreeResponseBody(name='body'),
}

/**
 * @summary Queries the directory structure of Spark applications.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkTemplateFolderTreeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkTemplateFolderTreeResponse
 */
async function getSparkTemplateFolderTreeWithOptions(request: GetSparkTemplateFolderTreeRequest, runtime: Util.RuntimeOptions): GetSparkTemplateFolderTreeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkTemplateFolderTree',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the directory structure of Spark applications.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkTemplateFolderTreeRequest
 * @return GetSparkTemplateFolderTreeResponse
 */
async function getSparkTemplateFolderTree(request: GetSparkTemplateFolderTreeRequest): GetSparkTemplateFolderTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkTemplateFolderTreeWithOptions(request, runtime);
}

model GetSparkTemplateFullTreeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
}

model GetSparkTemplateFullTreeResponseBody = {
  data?: string(name='Data', description='The directory structure of Spark applications. Fields in the response parameter:

*   **Uid**: the UID of the Alibaba Cloud account.

*   **Type**: the application template type. Valid values:

    *   **FOLDER**
    *   **FILE**

*   **Parent**: indicates whether a child directory exists. Valid values:

    *   **0**: no.
    *   **-1**: yes.

*   **Children**: the child directory.

*   **LastModified**: the time when applications are last modified. This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

*   **AppType**: the application type. Valid values:

    *   **SQL**
    *   **STREAMING**
    *   **BATCH**

*   **Name**: the name of the directory or application.

*   **Id**: the directory ID or application ID.', example='{     "Uid": 10415777****,     "Type": "FOLDER",     "Parent": -1,     "Children": [       {         "LastModified": 1648544748,         "Uid": 104157779****,         "Type": "FILE",         "Parent": 0,         "Id": s202204132****,         "AppType": "SQL",         "Name": "f"       },       {         "LastModified": 1648544956,         "Uid": 1041577795****,         "Type": "FOLDER",         "Parent": 0,         "Id": 157,         "Name": "f3333"       }     ],     "Id": 725204,     "Name": "root"   }'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model GetSparkTemplateFullTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkTemplateFullTreeResponseBody(name='body'),
}

/**
 * @summary Queries the directory structure of Spark applications.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkTemplateFullTreeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkTemplateFullTreeResponse
 */
async function getSparkTemplateFullTreeWithOptions(request: GetSparkTemplateFullTreeRequest, runtime: Util.RuntimeOptions): GetSparkTemplateFullTreeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkTemplateFullTree',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the directory structure of Spark applications.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request GetSparkTemplateFullTreeRequest
 * @return GetSparkTemplateFullTreeResponse
 */
async function getSparkTemplateFullTree(request: GetSparkTemplateFullTreeRequest): GetSparkTemplateFullTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkTemplateFullTreeWithOptions(request, runtime);
}

model GetSparkWarehouseBatchSQLRequest {
  agency?: string(name='Agency', description='The name of the client, which can be up to 16 characters in length. Specify a descriptive name that makes it easy to identify.', example='DMS'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-uf6485635f***'),
  queryId?: string(name='QueryId', description='The query ID of the Spark SQL statement.

This parameter is required.', example='sq2024123*****'),
}

model GetSparkWarehouseBatchSQLResponseBody = {
  data?: SparkBatchSQL(name='Data', description='The returned data.', example='{\\\\"DBClusterId\\\\": \\\\"amv-uf6485635fz852mn\\\\", \\\\"Statements\\\\": [{\\\\"Code\\\\": \\\\"show databases\\\\", \\\\"State\\\\": \\\\"FINISHED\\\\", \\\\"StatementId\\\\": \\\\"sq202501141001sh8e12e080006846-0000\\\\", \\\\"Result\\\\": \\\\"+--------------------+n'),
  requestId?: string(name='RequestId', description='The request ID.', example='3D44EDA0-A9DC-580D-9B5A-019370C075F4'),
}

model GetSparkWarehouseBatchSQLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSparkWarehouseBatchSQLResponseBody(name='body'),
}

/**
 * @summary Queries the execution result of a Spark SQL statement.
 *
 * @param request GetSparkWarehouseBatchSQLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSparkWarehouseBatchSQLResponse
 */
async function getSparkWarehouseBatchSQLWithOptions(request: GetSparkWarehouseBatchSQLRequest, runtime: Util.RuntimeOptions): GetSparkWarehouseBatchSQLResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.agency)) {
    body['Agency'] = request.agency;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.queryId)) {
    body['QueryId'] = request.queryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSparkWarehouseBatchSQL',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution result of a Spark SQL statement.
 *
 * @param request GetSparkWarehouseBatchSQLRequest
 * @return GetSparkWarehouseBatchSQLResponse
 */
async function getSparkWarehouseBatchSQL(request: GetSparkWarehouseBatchSQLRequest): GetSparkWarehouseBatchSQLResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSparkWarehouseBatchSQLWithOptions(request, runtime);
}

model GetTableRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='amv-*******'),
  dbName?: string(name='DbName', description='The name of the database.', example='dbName'),
  regionId?: string(name='RegionId', description='The ID of the region in which the cluster resides.

This parameter is required.', example='cn-hangzhou'),
  tableName?: string(name='TableName', description='The name of the table.', example='tableName'),
}

model GetTableResponseBody = {
  code?: long(name='Code', description='The error code returned.', example='0'),
  message?: string(name='Message', description='The error message returned.', example='""'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  success?: boolean(name='Success', description='Indicates whether the query succeeded.', example='true'),
  table?: TableModel(name='Table', description='The information about the table.'),
}

model GetTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTableResponseBody(name='body'),
}

/**
 * @summary 获取表
 *
 * @param request GetTableRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTableResponse
 */
async function getTableWithOptions(request: GetTableRequest, runtime: Util.RuntimeOptions): GetTableResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTable',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取表
 *
 * @param request GetTableRequest
 * @return GetTableResponse
 */
async function getTable(request: GetTableRequest): GetTableResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTableWithOptions(request, runtime);
}

model GetTableColumnsRequest {
  columnName?: string(name='ColumnName', description='The name of the column.', example='assist_user_phone'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp11q28kvl688****'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model GetTableColumnsResponseBody = {
  data?: {
    pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
    table?: TableDetailModel(name='Table', description='The information about the table.'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='15'),
  }(name='Data', description='The queried data.'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='15'),
}

model GetTableColumnsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTableColumnsResponseBody(name='body'),
}

/**
 * @summary Queries the information about columns.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetTableColumnsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTableColumnsResponse
 */
async function getTableColumnsWithOptions(request: GetTableColumnsRequest, runtime: Util.RuntimeOptions): GetTableColumnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.columnName)) {
    query['ColumnName'] = request.columnName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTableColumns',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about columns.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetTableColumnsRequest
 * @return GetTableColumnsResponse
 */
async function getTableColumns(request: GetTableColumnsRequest): GetTableColumnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTableColumnsWithOptions(request, runtime);
}

model GetTableDDLRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1ub9grke1****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model GetTableDDLResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='863D51B7-5321-41D8-A0B6-A088B0******'),
  SQL?: string(name='SQL', description='The SQL statement.', example='create table (
 id varchar(32)
);'),
}

model GetTableDDLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTableDDLResponseBody(name='body'),
}

/**
 * @summary Queries the statement that is used to create a table.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetTableDDLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTableDDLResponse
 */
async function getTableDDLWithOptions(request: GetTableDDLRequest, runtime: Util.RuntimeOptions): GetTableDDLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTableDDL',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statement that is used to create a table.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetTableDDLRequest
 * @return GetTableDDLResponse
 */
async function getTableDDL(request: GetTableDDLRequest): GetTableDDLResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTableDDLWithOptions(request, runtime);
}

model GetTableObjectsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bp1565u55p32****'),
  filterDescription?: string(name='FilterDescription', description='The description of the table.', example='description'),
  filterOwner?: string(name='FilterOwner', description='The owner of the table.', example='admin'),
  filterTblName?: string(name='FilterTblName', description='The name of the table.', example='test_tbl'),
  filterTblType?: string(name='FilterTblType', description='The type of the table.

Valid values:

DIMENSION_TABLE

FACT_TABLE

EXTERNAL_TABLE

Default value: null.', example='FACT_TABLE'),
  orderBy?: string(name='OrderBy', description='The order in which the fields to be returned are sorted.

Valid values:

*   Asc
*   Desc

Values for fields:

TableName

TableSize

CreateTime

UpdateTime

Default value: {"Type": "Desc","Field": "TableName"};', example='{"Type": "Desc","Field": "TableName"}'),
  pageNumber?: long(name='PageNumber', description='The number of the page to return. The value is an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
  regionId?: string(name='RegionId', description='The ID of the region in which the cluster resides.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
}

model GetTableObjectsResponseBody = {
  data?: {
    pageNumber?: long(name='PageNumber', description='The number of the returned page. The value is an integer that is greater than 0. Default value: **1**.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries returned per page. Default value: 30. Valid values:

*   **30**
*   **50**
*   **100**', example='30'),
    tableSummaryModels?: [
      TableSummaryModel
    ](name='TableSummaryModels', description='Details of the tables.'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
  }(name='Data', description='The data returned.'),
  pageNumber?: long(name='PageNumber', description='The number of the returned page. The value is an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page. Default value: 30. Valid values:

*   **30**
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='863D51B7-5321-41D8-A0B6-A088B0******'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model GetTableObjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTableObjectsResponseBody(name='body'),
}

/**
 * @summary 获取table概要信息
 *
 * @param request GetTableObjectsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTableObjectsResponse
 */
async function getTableObjectsWithOptions(request: GetTableObjectsRequest, runtime: Util.RuntimeOptions): GetTableObjectsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.filterDescription)) {
    query['FilterDescription'] = request.filterDescription;
  }
  if (!Util.isUnset(request.filterOwner)) {
    query['FilterOwner'] = request.filterOwner;
  }
  if (!Util.isUnset(request.filterTblName)) {
    query['FilterTblName'] = request.filterTblName;
  }
  if (!Util.isUnset(request.filterTblType)) {
    query['FilterTblType'] = request.filterTblType;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTableObjects',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取table概要信息
 *
 * @param request GetTableObjectsRequest
 * @return GetTableObjectsResponse
 */
async function getTableObjects(request: GetTableObjectsRequest): GetTableObjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTableObjectsWithOptions(request, runtime);
}

model GetViewDDLRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1ub9grke1****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  viewName?: string(name='ViewName', description='The name of the view.', example='v_modbus'),
}

model GetViewDDLResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='421794A3-72A5-5D27-9E8B-A75A4C503E17'),
  SQL?: string(name='SQL', description='The SQL statement.', example='CREATE VIEW `test`.`test_view` AS SELECT
  `id`
, `name`
FROM
  `test_tbl_adb`'),
}

model GetViewDDLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetViewDDLResponseBody(name='body'),
}

/**
 * @summary Queries the statement that is used to create a view.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetViewDDLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetViewDDLResponse
 */
async function getViewDDLWithOptions(request: GetViewDDLRequest, runtime: Util.RuntimeOptions): GetViewDDLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.viewName)) {
    query['ViewName'] = request.viewName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetViewDDL',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statement that is used to create a view.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetViewDDLRequest
 * @return GetViewDDLResponse
 */
async function getViewDDL(request: GetViewDDLRequest): GetViewDDLResponse {
  var runtime = new Util.RuntimeOptions{};
  return getViewDDLWithOptions(request, runtime);
}

model GetViewObjectsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  filterOwner?: string(name='FilterOwner', description='The owner of the view.', example='admin'),
  filterViewName?: string(name='FilterViewName', description='The name of the view.', example='test_filter'),
  filterViewType?: string(name='FilterViewType', description='The type of the view.

Valid values:

\\\\-VIRTUAL_VIEW

\\\\-MATERIALIZED_VIEW

Default value: null.', example='VIRTUAL_VIEW'),
  orderBy?: string(name='OrderBy', description='The order in which you want to sort the query results. Valid values for Type:

*   Asc
*   Desc

Valid values for Field: -ViewName

\\\\-CreateTime

\\\\-UpdateTime

Default value: {"Type": "Desc","Field": "ViewName"}.', example='{"Type": "Desc","Field": "ViewName"}'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  showMvBaseTable?: boolean(name='ShowMvBaseTable'),
}

model GetViewObjectsResponseBody = {
  data?: {
    pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
    tableSummaryModels?: [
      TableSummaryModel
    ](name='TableSummaryModels', description='The queried views.'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
  }(name='Data', description='The returned data.'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model GetViewObjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetViewObjectsResponseBody(name='body'),
}

/**
 * @summary Queries the information about views.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetViewObjectsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetViewObjectsResponse
 */
async function getViewObjectsWithOptions(request: GetViewObjectsRequest, runtime: Util.RuntimeOptions): GetViewObjectsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.filterOwner)) {
    query['FilterOwner'] = request.filterOwner;
  }
  if (!Util.isUnset(request.filterViewName)) {
    query['FilterViewName'] = request.filterViewName;
  }
  if (!Util.isUnset(request.filterViewType)) {
    query['FilterViewType'] = request.filterViewType;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.showMvBaseTable)) {
    query['ShowMvBaseTable'] = request.showMvBaseTable;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetViewObjects',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about views.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 *
 * @param request GetViewObjectsRequest
 * @return GetViewObjectsResponse
 */
async function getViewObjects(request: GetViewObjectsRequest): GetViewObjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getViewObjectsWithOptions(request, runtime);
}

model GrantOperatorPermissionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp1565u55p32****'),
  expiredTime?: string(name='ExpiredTime', description='The expiration time of the service account permissions. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2022-11-30T00:00:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  privileges?: string(name='Privileges', description='The name of the permissions. Valid values:

*   **Control**: the configuration permissions. The service account is granted the permissions to query and modify cluster configurations.
*   **Data**: the data permissions. The service account is granted the permissions to query schemas, indexes, and SQL statements.

This parameter is required.', example='Control'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GrantOperatorPermissionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A438072A-E2E7-5509-9A3F-66293512A820'),
}

model GrantOperatorPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GrantOperatorPermissionResponseBody(name='body'),
}

/**
 * @summary Grants permissions to the service account of an AnalyticDB for MySQL cluster.
 *
 * @param request GrantOperatorPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GrantOperatorPermissionResponse
 */
async function grantOperatorPermissionWithOptions(request: GrantOperatorPermissionRequest, runtime: Util.RuntimeOptions): GrantOperatorPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.expiredTime)) {
    query['ExpiredTime'] = request.expiredTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.privileges)) {
    query['Privileges'] = request.privileges;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantOperatorPermission',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Grants permissions to the service account of an AnalyticDB for MySQL cluster.
 *
 * @param request GrantOperatorPermissionRequest
 * @return GrantOperatorPermissionResponse
 */
async function grantOperatorPermission(request: GrantOperatorPermissionRequest): GrantOperatorPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantOperatorPermissionWithOptions(request, runtime);
}

model KillProcessRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='am-xxxx'),
  processId?: string(name='ProcessId', description='The query ID.

>  You can call the [DescribeProcessList](https://help.aliyun.com/document_detail/143382.html) operation to query the IDs of queries that are being executed.', example='202011191048151921681492420315100****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model KillProcessResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model KillProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: KillProcessResponseBody(name='body'),
}

/**
 * @summary Terminates an ongoing query.
 *
 * @param request KillProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return KillProcessResponse
 */
async function killProcessWithOptions(request: KillProcessRequest, runtime: Util.RuntimeOptions): KillProcessResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'KillProcess',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates an ongoing query.
 *
 * @param request KillProcessRequest
 * @return KillProcessResponse
 */
async function killProcess(request: KillProcessRequest): KillProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return killProcessWithOptions(request, runtime);
}

model KillSparkAppRequest {
  appId?: string(name='AppId', description='The ID of the Spark application that you want to terminate.

This parameter is required.', example='s202204132018hzprec1ac****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.', example='amv-bp1ub9grke1****'),
}

model KillSparkAppResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The Spark application ID.', example='s202204132018hzprec1ac****'),
    appName?: string(name='AppName', description='The name of the application.', example='LAKEHOUSE-1-1'),
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-bp1c3em7b2e****'),
    message?: string(name='Message', description='The error message returned.', example='[Advisor] Advisor feature is not available for instance: am-2ze292w4fyglwxxxx'),
    state?: string(name='State', description='The execution state of the Spark application. Valid values:

*   **SUBMITTED**
*   **STARTING**
*   **RUNNING**
*   **FAILING**
*   **FAILED**
*   **KILLING**
*   **KILLED**
*   **SUCCEEDING**
*   **COMPLETED**
*   **FATAL**
*   **UNKNOWN**', example='running'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='69D0810B-F9F5-5F4C-A57F-DF36133B63C9'),
}

model KillSparkAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: KillSparkAppResponseBody(name='body'),
}

/**
 * @summary Terminates a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request KillSparkAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return KillSparkAppResponse
 */
async function killSparkAppWithOptions(request: KillSparkAppRequest, runtime: Util.RuntimeOptions): KillSparkAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'KillSparkApp',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request KillSparkAppRequest
 * @return KillSparkAppResponse
 */
async function killSparkApp(request: KillSparkAppRequest): KillSparkAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return killSparkAppWithOptions(request, runtime);
}

model KillSparkLogAnalyzeTaskRequest {
  taskId?: long(name='TaskId', description='The ID of the Spark log analysis task. You can call the ListSparkLogAnalyzeTasks operation to query the IDs and states of all analysis tasks in the current cluster.

This parameter is required.', example='15'),
}

model KillSparkLogAnalyzeTaskResponseBody = {
  data?: SparkAnalyzeLogTask(name='Data', description='The information about the Spark log analysis task.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1DF5AF5B-C803-1861-A0FF-63666A557709'),
}

model KillSparkLogAnalyzeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: KillSparkLogAnalyzeTaskResponseBody(name='body'),
}

/**
 * @summary Terminates a Spark log analysis task and queries the information about the analysis task.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request KillSparkLogAnalyzeTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return KillSparkLogAnalyzeTaskResponse
 */
async function killSparkLogAnalyzeTaskWithOptions(request: KillSparkLogAnalyzeTaskRequest, runtime: Util.RuntimeOptions): KillSparkLogAnalyzeTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'KillSparkLogAnalyzeTask',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates a Spark log analysis task and queries the information about the analysis task.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request KillSparkLogAnalyzeTaskRequest
 * @return KillSparkLogAnalyzeTaskResponse
 */
async function killSparkLogAnalyzeTask(request: KillSparkLogAnalyzeTaskRequest): KillSparkLogAnalyzeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return killSparkLogAnalyzeTaskWithOptions(request, runtime);
}

model KillSparkSQLEngineRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-8vbn8pq537k8w****'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

This parameter is required.', example='spark_test'),
}

model KillSparkSQLEngineResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model KillSparkSQLEngineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: KillSparkSQLEngineResponseBody(name='body'),
}

/**
 * @summary Shuts down a Spark SQL engine.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request KillSparkSQLEngineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return KillSparkSQLEngineResponse
 */
async function killSparkSQLEngineWithOptions(request: KillSparkSQLEngineRequest, runtime: Util.RuntimeOptions): KillSparkSQLEngineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'KillSparkSQLEngine',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Shuts down a Spark SQL engine.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request KillSparkSQLEngineRequest
 * @return KillSparkSQLEngineResponse
 */
async function killSparkSQLEngine(request: KillSparkSQLEngineRequest): KillSparkSQLEngineResponse {
  var runtime = new Util.RuntimeOptions{};
  return killSparkSQLEngineWithOptions(request, runtime);
}

model ListApsLifecycleStrategyRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.', example='2024-01-02T11:22Z'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.', example='2024-01-01T11:22Z'),
}

model ListApsLifecycleStrategyResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  items?: [ 
    {
      apsJobId?: string(name='ApsJobId', description='The job ID.', example='aps-******'),
      createdTime?: string(name='CreatedTime', description='The time when the policy was created.', example='2021-06-30T02:44:27Z'),
      DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-*******'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the policy was modified.', example='2021-07-03T06:33:00Z'),
      operationTables?: [ 
        {
          databaseName?: string(name='DatabaseName', description='The name of the database.', example='test'),
          processAll?: string(name='ProcessAll', description='Indicates whether all tables in the database are selected.', example='true'),
          tableNames?: [ string ](name='TableNames', description='The names of the tables.'),
        }
      ](name='OperationTables', description='The operation tables.'),
      status?: string(name='Status', description='The status of the lifecycle management policy. Valid values:

1.  on: enables the current policy.
2.  off: disables the current policy.', example='on'),
      strategyDatabases?: long(name='StrategyDatabases', description='The number of databases that are managed during the lifecycle management.', example='5'),
      strategyDesc?: string(name='StrategyDesc', description='The description of the lifecycle management policy.', example='test'),
      strategyName?: string(name='StrategyName', description='The name of the lifecycle management policy.', example='test'),
      strategyTables?: long(name='StrategyTables', description='The number of tables that are managed during the lifecycle management.', example='5'),
      strategyType?: string(name='StrategyType', description='The type of the lifecycle management policy.', example='KEEP_BY_TIME'),
      strategyValue?: string(name='StrategyValue', description='The value of the lifecycle management policy.', example='10'),
    }
  ](name='Items', description='The queried lifecycle management policies.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListApsLifecycleStrategyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApsLifecycleStrategyResponseBody(name='body'),
}

/**
 * @summary Queries a list of lifecycle management policies of an AnalyticDB for MySQL cluster.
 *
 * @param request ListApsLifecycleStrategyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApsLifecycleStrategyResponse
 */
async function listApsLifecycleStrategyWithOptions(request: ListApsLifecycleStrategyRequest, runtime: Util.RuntimeOptions): ListApsLifecycleStrategyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListApsLifecycleStrategy',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of lifecycle management policies of an AnalyticDB for MySQL cluster.
 *
 * @param request ListApsLifecycleStrategyRequest
 * @return ListApsLifecycleStrategyResponse
 */
async function listApsLifecycleStrategy(request: ListApsLifecycleStrategyRequest): ListApsLifecycleStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApsLifecycleStrategyWithOptions(request, runtime);
}

model ListApsOptimizationStrategyRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model ListApsOptimizationStrategyResponseBody = {
  code?: string(name='Code', description='The response code.', example='InvalidInput'),
  data?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-23xxxx'),
      status?: string(name='Status', description='The status of the lifecycle management policy. Valid values:

1.  on: enabled.
2.  off: disabled.', example='off'),
      strategyDesc?: string(name='StrategyDesc', description='The description of the lifecycle management policy.', example='test'),
      strategyName?: string(name='StrategyName', description='The name of the lifecycle management policy.', example='test'),
      strategyType?: string(name='StrategyType', description='The type of the lifecycle management policy. Only StrategyValue is returned.', example='StrategyValue'),
    }
  ](name='Data', description='The returned data.', example='-'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model ListApsOptimizationStrategyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApsOptimizationStrategyResponseBody(name='body'),
}

/**
 * @summary Queries a list of lake storage optimization policies for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ListApsOptimizationStrategyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApsOptimizationStrategyResponse
 */
async function listApsOptimizationStrategyWithOptions(request: ListApsOptimizationStrategyRequest, runtime: Util.RuntimeOptions): ListApsOptimizationStrategyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListApsOptimizationStrategy',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of lake storage optimization policies for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ListApsOptimizationStrategyRequest
 * @return ListApsOptimizationStrategyResponse
 */
async function listApsOptimizationStrategy(request: ListApsOptimizationStrategyRequest): ListApsOptimizationStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApsOptimizationStrategyWithOptions(request, runtime);
}

model ListApsOptimizationTasksRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.', example='2022-09-30T00:15Z'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.', example='2022-01-23T02:18Z'),
  strategyType?: string(name='StrategyType', description='The type of the lifecycle management policy.

This parameter is required.', example='StrategyValue'),
}

model ListApsOptimizationTasksResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  items?: [ 
    {
      computeUnit?: string(name='ComputeUnit', description='The computing resources used by the optimization job.', example='2'),
      createdTime?: string(name='CreatedTime', description='The time when the optimization job was created.', example='2022-01-23T02:18Z'),
      DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-*******'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the optimization job was modified.', example='2022-09-30T00:15Z'),
      strategyType?: string(name='StrategyType', description='The type of the lifecycle management policy.', example='StrategyValue'),
      taskDesc?: string(name='TaskDesc', description='The description of the optimization job.', example='test'),
      taskDuration?: long(name='TaskDuration', description='The execution duration of the optimization job.', example='1000'),
      taskId?: string(name='TaskId', description='The job ID.', example='sj-hz******'),
      taskMessage?: string(name='TaskMessage', description='The error message.', example='-'),
      taskStatus?: string(name='TaskStatus', description='The execution status. Valid values:

1.  NEW
2.  RUNNING
3.  SUCCESS
4.  STOPPED
5.  FAILED', example='RUNNING'),
    }
  ](name='Items', description='The queried optimization jobs.', example='-'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='SUCCESS'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='15'),
}

model ListApsOptimizationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApsOptimizationTasksResponseBody(name='body'),
}

/**
 * @summary Queries a list of optimization jobs executed based on a lifecycle management policy. The system runs optimization jobs on a regular basis based on lifecycle management policies.
 *
 * @param request ListApsOptimizationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApsOptimizationTasksResponse
 */
async function listApsOptimizationTasksWithOptions(request: ListApsOptimizationTasksRequest, runtime: Util.RuntimeOptions): ListApsOptimizationTasksResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.strategyType)) {
    body['StrategyType'] = request.strategyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListApsOptimizationTasks',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of optimization jobs executed based on a lifecycle management policy. The system runs optimization jobs on a regular basis based on lifecycle management policies.
 *
 * @param request ListApsOptimizationTasksRequest
 * @return ListApsOptimizationTasksResponse
 */
async function listApsOptimizationTasks(request: ListApsOptimizationTasksRequest): ListApsOptimizationTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApsOptimizationTasksWithOptions(request, runtime);
}

model ListLakeStoragesRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  filter?: string(name='Filter', description='The filter parameters that you want to use to query lake storages. Specify multiple parameters in an AND relationship. For example, if you want to query lake storage whose names are in the range of i-a123, or i-b123, and in the Stopped state, set this parameter to \\\\&Filter. 1.Name=InstanceName\\\\&Filter. 1.Value.1=i-a123\\\\&Filter.1.Value.2=i-b123\\\\&Filter.2.Name=Status\\\\&Filter. 2.Value=Stopped.', example='-'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model ListLakeStoragesResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  items?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the lake storage was created.', example='2021-04-01T09:50:18Z'),
      creatorUid?: string(name='CreatorUid', description='The creator UID.', example='123456'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.', example='amv-*******'),
      description?: string(name='Description', description='The description of the lake storage.', example='Create a role to run ROS StackGroups.'),
      fileSize?: string(name='FileSize', description='The size of data files.', example='651'),
      lakeStorageId?: string(name='LakeStorageId', description='The unique identifier of the lake storage.', example='-'),
      operatorUid?: string(name='OperatorUid', description='The operator UID.', example='123456'),
      ownerUid?: string(name='OwnerUid', description='The queried lake storage.', example='123456'),
      permissions?: [ 
        {
          account?: string(name='Account', description='The database account ID.', example='-'),
          read?: boolean(name='Read', description='The read permissions.', example='true'),
          type?: string(name='Type', description='The type of the database account.', example='-'),
          write?: boolean(name='Write', description='The write permissions.', example='false'),
        }
      ](name='Permissions', description='The permissions on the lake storage.', example='-'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      tableCount?: int32(name='TableCount', description='The number of tables.', example='30'),
      totalRows?: long(name='TotalRows', description='The total number of entries returned.', example='30'),
      totalStorage?: string(name='TotalStorage', description='The total storage size.', example='111333'),
      updateTime?: string(name='UpdateTime', description='The time when the lake storage was last updated.', example='2024-03-15T02:24:32'),
    }
  ](name='Items', description='The queried lake storages.', example='-'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='Success'),
  pageNumber?: int32(name='PageNumber', description='The token that is used for paging when the number of results is greater than the value of MaxResults.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='****-964D-****-9D31-****'),
  success?: boolean(name='Success', description='Indicates whether the dry run succeeds. Valid values:

*   **true**
*   **false**', example='true'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='30'),
}

model ListLakeStoragesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLakeStoragesResponseBody(name='body'),
}

/**
 * @summary Queries a list of lake storages.
 *
 * @param request ListLakeStoragesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLakeStoragesResponse
 */
async function listLakeStoragesWithOptions(request: ListLakeStoragesRequest, runtime: Util.RuntimeOptions): ListLakeStoragesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListLakeStorages',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of lake storages.
 *
 * @param request ListLakeStoragesRequest
 * @return ListLakeStoragesResponse
 */
async function listLakeStorages(request: ListLakeStoragesRequest): ListLakeStoragesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listLakeStoragesWithOptions(request, runtime);
}

model ListResultExportJobHistoryRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-7xv5ty5m9o4v****'),
  databaseUser?: string(name='DatabaseUser', description='The name of the database account.', example='test1'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2023-05-25T06:54:00Z'),
  order?: {
    field?: string(name='Field', description='The field that is used to sort the SQL statements. Valid values:

*   CreateTime
*   DatabaseUser
*   TimeCost
*   ResourceGroup
*   Status
*   Progress
*   ExportRows', example='DatabaseUser'),
    type?: string(name='Type', description='The sorting order. Valid values (case-insensitive):

*   **Desc**: descending order.
*   **Asc**: ascending order.', example='Desc'),
  }(name='Order', description='The order in which to sort the SQL statements by field, which contains the `Field` and `Type` fields. Specify the order in the JSON format. Example: `[{"Field":"CreateTimee", "Type": "desc" }]`.

*   `Field` specifies the field that is used to sort the SQL statements. Valid values:

    *   `CreateTime`: the time when the result set export job was created.
    *   `Status`: the execution status.
    *   `DatabaseUser`: the name of the database account.
    *   `TimeCost`: the execution duration.
    *   `ResourceGroup`: the name of the resource group.
    *   `ExportRows`: the number of exported rows.
    *   `Progress`: the export progress.

*   `Type` specifies the sorting order. Valid values (case-insensitive):

    *   `Desc`: descending order.
    *   `Asc`: ascending order.'),
  pageNumber?: string(name='PageNumber', description='The page number. Pages start from page 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The name of the resource group that runs the result set export jobs. You can use this parameter to query the execution records of export jobs that are run in a specific resource group.', example='user_default'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.', example='2022-01-01T12:01:00Z'),
  statusList?: [ string ](name='StatusList', description='The execution status of result set export jobs. You can use this parameter to query the execution records of export jobs that are in a specific state.'),
}

model ListResultExportJobHistoryShrinkRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-7xv5ty5m9o4v****'),
  databaseUser?: string(name='DatabaseUser', description='The name of the database account.', example='test1'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2023-05-25T06:54:00Z'),
  orderShrink?: string(name='Order', description='The order in which to sort the SQL statements by field, which contains the `Field` and `Type` fields. Specify the order in the JSON format. Example: `[{"Field":"CreateTimee", "Type": "desc" }]`.

*   `Field` specifies the field that is used to sort the SQL statements. Valid values:

    *   `CreateTime`: the time when the result set export job was created.
    *   `Status`: the execution status.
    *   `DatabaseUser`: the name of the database account.
    *   `TimeCost`: the execution duration.
    *   `ResourceGroup`: the name of the resource group.
    *   `ExportRows`: the number of exported rows.
    *   `Progress`: the export progress.

*   `Type` specifies the sorting order. Valid values (case-insensitive):

    *   `Desc`: descending order.
    *   `Asc`: ascending order.'),
  pageNumber?: string(name='PageNumber', description='The page number. Pages start from page 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The name of the resource group that runs the result set export jobs. You can use this parameter to query the execution records of export jobs that are run in a specific resource group.', example='user_default'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.', example='2022-01-01T12:01:00Z'),
  statusListShrink?: string(name='StatusList', description='The execution status of result set export jobs. You can use this parameter to query the execution records of export jobs that are in a specific state.'),
}

model ListResultExportJobHistoryResponseBody = {
  code?: string(name='Code', description='The HTTP status code.', example='InvalidInput'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  items?: [ 
    {
      aliUid?: string(name='AliUid', description='The RAM user ID.', example='120010511678****'),
      createTime?: string(name='CreateTime', description='The time when the result set export job was created. The time follows the ISO 8601 standard in the *yyyy-mm-ddThh:mm:ssZ* format. The time is displayed in UTC.', example='2022-04-01T09:50:18Z'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.', example='amv-7xv5ty5m9o4v****'),
      databaseUser?: string(name='DatabaseUser', description='The name of the database account that is associated with the RAM user.', example='ram_user'),
      endTime?: string(name='EndTime', description='The end time of the result set export job. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.

>  The end time must be later than the start time.', example='2023-06-15T02:13:00Z'),
      engine?: string(name='Engine', description='The engine that is used to execute the result set export job. Only XIHE is returned.', example='XIHE'),
      exportJobId?: string(name='ExportJobId', description='The unique identifier of the result set export job.', example='export_2024051319271219802100800401300****'),
      exportPath?: string(name='ExportPath', description='The complete URL of the path to store the exported result set.'),
      exportRows?: string(name='ExportRows', description='The number of exported rows. This parameter is returned only when the request was successful.', example='10000'),
      exportType?: string(name='ExportType', description='The type of the result set export job.', example='-'),
      isExpired?: boolean(name='IsExpired', description='Indicates whether the result set export job has expired. Valid values:

*   **false**
*   **true**'),
      message?: string(name='Message', description='The returned message. This parameter is returned only when the request failed.', example='Failed to execute SQL'),
      processId?: string(name='ProcessId', description='The query ID that can be used for diagnostics.

>  You can call the [DescribeDiagnosisSQLInfo](https://help.aliyun.com/document_detail/612337.html) operation to query the execution information about a query.', example='202306121421111720161451770345339****'),
      progress?: string(name='Progress', description='The progress of the result set export job. Unit: %. Valid values: 0 to 100.', example='30'),
      resourceGroup?: string(name='ResourceGroup', description='The name of the resource group that runs the result set export job.', example='test'),
      schema?: string(name='Schema', description='The name of the database.', example='lake_db'),
      sql?: string(name='Sql', description='The SQL statement that is used in the result set export job.', example='SELECT * FROM `ADB_SampleData_TPCH`.`supplier` LIMIT 20'),
      startTime?: string(name='StartTime', description='The start time of the result set export job. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2021-07-03T04:00:00Z'),
      status?: string(name='Status', description='The execution status of the result set export job. Valid values:

1.  **SUBMITTED**
2.  **RUNNING**
3.  **SUCCEEDED**
4.  **FAILED**', example='RUNNING'),
      timeCost?: long(name='TimeCost', description='The amount of time consumed to export execution records. Unit: milliseconds.

>  The value is the duration between the time when the result set export job starts and the time when the result set export job ends.', example='560'),
    }
  ](name='Items', description='The queried result set export jobs.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, an **OK** message is returned.
*   If the request failed, an error message is returned.', example='OK'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='174'),
}

model ListResultExportJobHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResultExportJobHistoryResponseBody(name='body'),
}

/**
 * @summary Queries the execution records of result set export jobs of a Resource Access Management (RAM) user.
 *
 * @param tmpReq ListResultExportJobHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResultExportJobHistoryResponse
 */
async function listResultExportJobHistoryWithOptions(tmpReq: ListResultExportJobHistoryRequest, runtime: Util.RuntimeOptions): ListResultExportJobHistoryResponse {
  Util.validateModel(tmpReq);
  var request = new ListResultExportJobHistoryShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.order)) {
    request.orderShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.order, 'Order', 'json');
  }
  if (!Util.isUnset(tmpReq.statusList)) {
    request.statusListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.statusList, 'StatusList', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.databaseUser)) {
    body['DatabaseUser'] = request.databaseUser;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.orderShrink)) {
    body['Order'] = request.orderShrink;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    body['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.statusListShrink)) {
    body['StatusList'] = request.statusListShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListResultExportJobHistory',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution records of result set export jobs of a Resource Access Management (RAM) user.
 *
 * @param request ListResultExportJobHistoryRequest
 * @return ListResultExportJobHistoryResponse
 */
async function listResultExportJobHistory(request: ListResultExportJobHistoryRequest): ListResultExportJobHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return listResultExportJobHistoryWithOptions(request, runtime);
}

model ListSparkAppAttemptsRequest {
  appId?: string(name='AppId', description='The ID of the Spark application.

> You can call the [ListSparkApps](https://help.aliyun.com/document_detail/455888.html) operation to query all application IDs.

This parameter is required.', example='s202204132018hzprec1ac****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-uf6o6m8p6x***'),
  pageNumber?: long(name='PageNumber', description='The page number. The value must be an integer that is greater than 0. Default value: **1**.

This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **10** (default)
*   **50**
*   **100**', example='10'),
}

model ListSparkAppAttemptsResponseBody = {
  data?: {
    attemptInfoList?: [
      SparkAttemptInfo
    ](name='AttemptInfoList', description='The queried attempts. Fields in the response parameter:

*   **AttemptId**: the attempt ID.

*   **State**: the state of the Spark application. Valid values:

    *   **SUBMITTED**
    *   **STARTING**
    *   **RUNNING**
    *   **FAILING**
    *   **FAILED**
    *   **KILLING**
    *   **KILLED**
    *   **SUCCEEDING**
    *   **COMPLETED**
    *   **FATAL**
    *   **UNKNOWN**

*   **Message**: the alert message that is returned. If no alert is generated, null is returned.

*   **Data** the data of the Spark application template.

*   **EstimateExecutionCpuTimeInSeconds**: the amount of time that is required to consume CPU resources for running the Spark application. Unit: milliseconds.

*   **LogRootPath**: the storage path of log files.

*   **LastAttemptId**: the ID of the last attempt.

*   **WebUiAddress**: the web UI URL.

*   **SubmittedTimeInMillis**: the time when the Spark application was submitted. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

*   **StartedTimeInMillis**: the time when the Spark application was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

*   **LastUpdatedTimeInMillis**: the time when the Spark application was last updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

*   **TerminatedTimeInMillis**: the time when the Spark application task was terminated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

*   **DBClusterId**: the ID of the cluster on which the Spark application runs.

*   **ResourceGroupName**: the name of the job resource group.

*   **DurationInMillis**: the amount of time that is required to run the Spark application. Unit: milliseconds.'),
    pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page.', example='10'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='3'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ListSparkAppAttemptsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSparkAppAttemptsResponseBody(name='body'),
}

/**
 * @summary Queries the information about retry attempts of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ListSparkAppAttemptsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSparkAppAttemptsResponse
 */
async function listSparkAppAttemptsWithOptions(request: ListSparkAppAttemptsRequest, runtime: Util.RuntimeOptions): ListSparkAppAttemptsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSparkAppAttempts',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about retry attempts of a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ListSparkAppAttemptsRequest
 * @return ListSparkAppAttemptsResponse
 */
async function listSparkAppAttempts(request: ListSparkAppAttemptsRequest): ListSparkAppAttemptsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSparkAppAttemptsWithOptions(request, runtime);
}

model ListSparkAppsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  filters?: string(name='Filters'),
  pageNumber?: long(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: **1**.

This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Default value: 10. Valid values:

- **10**
- **50**
- **100**', example='30'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the job resource group.', example='test_instance'),
}

model ListSparkAppsResponseBody = {
  data?: {
    appInfoList?: [
      SparkAppInfo
    ](name='AppInfoList', description='Details of the applications. Fields in the response parameter:

- **Data**: the data of the Spark application template.
- **EstimateExecutionCpuTimeInSeconds**: the amount of time it takes to consume CPU resources for running the Spark application. Unit: milliseconds.
- **LogRootPath**: the storage path of log files.
- **LastAttemptId**: the most recent attempt ID.
- **WebUiAddress**: the web UI URL.
- **SubmittedTimeInMillis**: the time when the Spark application was submitted. The time is displayed in the UNIX timestamp format. Unit: milliseconds.
- **StartedTimeInMillis**: the time when the Spark application was created. The time is displayed in the UNIX timestamp format. Unit: milliseconds.
- **LastUpdatedTimeInMillis**: the time when the Spark application was last updated. The time is displayed in the UNIX timestamp format. Unit: milliseconds.
- **TerminatedTimeInMillis**: the time when the Spark application task was terminated. The time is displayed in the UNIX timestamp format. Unit: milliseconds.
- **DBClusterId**: the ID of the cluster on which the Spark application runs.
- **ResourceGroupName**: the name of the job resource group.
- **DurationInMillis**: the amount of time it takes to run the Spark application. Unit: milliseconds.'),
    pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='10'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
  }(name='Data', description='The data returned.'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListSparkAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSparkAppsResponseBody(name='body'),
}

/**
 * @summary Queries the Spark applications that run on an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @param request ListSparkAppsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSparkAppsResponse
 */
async function listSparkAppsWithOptions(request: ListSparkAppsRequest, runtime: Util.RuntimeOptions): ListSparkAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.filters)) {
    query['Filters'] = request.filters;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSparkApps',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the Spark applications that run on an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @param request ListSparkAppsRequest
 * @return ListSparkAppsResponse
 */
async function listSparkApps(request: ListSparkAppsRequest): ListSparkAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSparkAppsWithOptions(request, runtime);
}

model ListSparkLogAnalyzeTasksRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-9scxs****'),
  pageNumber?: long(name='PageNumber', description='The page number.

This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
}

model ListSparkLogAnalyzeTasksResponseBody = {
  data?: {
    pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
    taskList?: [
      SparkAnalyzeLogTask
    ](name='TaskList', description='The queried Spark log analysis tasks.'),
    totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='100'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1DF5AF5B-C803-1861-A0FF-63666A557709'),
}

model ListSparkLogAnalyzeTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSparkLogAnalyzeTasksResponseBody(name='body'),
}

/**
 * @summary Queries a list of Spark log analysis tasks.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ListSparkLogAnalyzeTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSparkLogAnalyzeTasksResponse
 */
async function listSparkLogAnalyzeTasksWithOptions(request: ListSparkLogAnalyzeTasksRequest, runtime: Util.RuntimeOptions): ListSparkLogAnalyzeTasksResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSparkLogAnalyzeTasks',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of Spark log analysis tasks.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ListSparkLogAnalyzeTasksRequest
 * @return ListSparkLogAnalyzeTasksResponse
 */
async function listSparkLogAnalyzeTasks(request: ListSparkLogAnalyzeTasksRequest): ListSparkLogAnalyzeTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSparkLogAnalyzeTasksWithOptions(request, runtime);
}

model ListSparkTemplateFileIdsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp11q28kvl688****'),
}

model ListSparkTemplateFileIdsResponseBody = {
  data?: [ long ](name='Data', description='The IDs of Spark template files.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ListSparkTemplateFileIdsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSparkTemplateFileIdsResponseBody(name='body'),
}

/**
 * @summary Queries a list of Spark template file IDs for AnalyticDB for MySQL clusters.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ListSparkTemplateFileIdsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSparkTemplateFileIdsResponse
 */
async function listSparkTemplateFileIdsWithOptions(request: ListSparkTemplateFileIdsRequest, runtime: Util.RuntimeOptions): ListSparkTemplateFileIdsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSparkTemplateFileIds',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of Spark template file IDs for AnalyticDB for MySQL clusters.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request ListSparkTemplateFileIdsRequest
 * @return ListSparkTemplateFileIdsResponse
 */
async function listSparkTemplateFileIds(request: ListSparkTemplateFileIdsRequest): ListSparkTemplateFileIdsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSparkTemplateFileIdsWithOptions(request, runtime);
}

model ListSparkWarehouseBatchSQLRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1ub9grke1****'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the interactive resource group for which the Spark engine is enabled.

This parameter is required.', example='test'),
}

model ListSparkWarehouseBatchSQLResponseBody = {
  data?: {
    pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
    queries?: [
      SparkBatchSQL
    ](name='Queries', description='The queried Spark SQL statements.'),
    total?: long(name='Total', description='The total number of entries.', example='0'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ListSparkWarehouseBatchSQLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSparkWarehouseBatchSQLResponseBody(name='body'),
}

/**
 * @summary Queries a list of Spark SQL statements.
 *
 * @param request ListSparkWarehouseBatchSQLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSparkWarehouseBatchSQLResponse
 */
async function listSparkWarehouseBatchSQLWithOptions(request: ListSparkWarehouseBatchSQLRequest, runtime: Util.RuntimeOptions): ListSparkWarehouseBatchSQLResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSparkWarehouseBatchSQL',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of Spark SQL statements.
 *
 * @param request ListSparkWarehouseBatchSQLRequest
 * @return ListSparkWarehouseBatchSQLResponse
 */
async function listSparkWarehouseBatchSQL(request: ListSparkWarehouseBatchSQLRequest): ListSparkWarehouseBatchSQLResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSparkWarehouseBatchSQLWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='212db86sca4384811e0b5e8707ec21345'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The cluster ID. You can specify N cluster IDs. Valid values of N: 1 to 50.

>  You must specify at least one of the ResourceId.N and Tag.N.Key parameters.'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **dbclusterlakeversion**.

This parameter is required.', example='dbclusterlakeversion'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. You can specify N tag keys. The tag key cannot be an empty string. Valid values of N: 1 to 20.

>  You must specify at least one of the ResourceId.N and Tag.N.Key parameters.', example='testkey1'),
      value?: string(name='Value', description='The tag value. You can specify N tag values. The tag value can be an empty string. Valid values of N: 1 to 20.', example='testvalue1'),
    }
  ](name='Tag', description='The tags.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='212db86sca4384811e0b5e8707ec21345'),
  requestId?: string(name='RequestId', description='The request ID.', example='184DE106-CB2C-4DD2-B57F-396652E6C8F8'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The cluster ID.', example='amv-bp1l20nxxxxxxxxxx'),
      resourceType?: string(name='ResourceType', description='The resource type.', example='dbclusterlakeversion'),
      tagKey?: string(name='TagKey', description='The tag key.', example='testkey1'),
      tagValue?: string(name='TagValue', description='The tag value.', example='testvalue1'),
    }
  ](name='TagResource')
  }(name='TagResources', description='The queried clusters and tags.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags that are added to AnalyticDB for MySQL clusters, or the AnalyticDB for MySQL clusters that have tags added.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the tags that are added to AnalyticDB for MySQL clusters, or the AnalyticDB for MySQL clusters that have tags added.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model LoadSampleDataSetRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-2ze0z517o1mgp66a'),
}

model LoadSampleDataSetResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-2ze0z517o1mgp66a'),
  requestId?: string(name='RequestId', description='The request ID.', example='FA31BE84-ABE8-554A-A769-5F860C34EE10'),
}

model LoadSampleDataSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LoadSampleDataSetResponseBody(name='body'),
}

/**
 * @summary Loads a built-in dataset.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request LoadSampleDataSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LoadSampleDataSetResponse
 */
async function loadSampleDataSetWithOptions(request: LoadSampleDataSetRequest, runtime: Util.RuntimeOptions): LoadSampleDataSetResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LoadSampleDataSet',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Loads a built-in dataset.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request LoadSampleDataSetRequest
 * @return LoadSampleDataSetResponse
 */
async function loadSampleDataSet(request: LoadSampleDataSetRequest): LoadSampleDataSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return loadSampleDataSetWithOptions(request, runtime);
}

model ModifyAccountDescriptionRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the database account.

*   The description cannot start with `http://` or `https://`.
*   The description must be 2 to 256 characters in length.

This parameter is required.', example='AccDesc'),
  accountName?: string(name='AccountName', description='The name of the database account.

>  You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/612430.html) operation to query the information about database accounts of an AnalyticDB for MySQL cluster, including database account names.

This parameter is required.', example='testacc'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
}

model ModifyAccountDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyAccountDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountDescriptionResponseBody(name='body'),
}

/**
 * @summary Modifies the description of a database account for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyAccountDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescriptionWithOptions(request: ModifyAccountDescriptionRequest, runtime: Util.RuntimeOptions): ModifyAccountDescriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAccountDescription',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the description of a database account for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyAccountDescriptionRequest
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescription(request: ModifyAccountDescriptionRequest): ModifyAccountDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAccountDescriptionWithOptions(request, runtime);
}

model ModifyAccountPrivilegesRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

This parameter is required.', example='account1'),
  accountPrivileges?: [ 
    {
      privilegeObject?: {
        column?: string(name='Column', description='The columns on which you want to grant permissions. This parameter must be specified when the PrivilegeType parameter is set to Column.', example='column1'),
        database?: string(name='Database', description='The databases on which you want to grant permissions. This parameter must be specified when the PrivilegeType parameter is set to Database, Table, or Column.', example='tsdb1'),
        table?: string(name='Table', description='The tables on which you want to grant permissions. This parameter must be specified when the PrivilegeType parameter is set to Table or Column.', example='table1'),
      }(name='PrivilegeObject', description='The objects on which you want to grant permissions, including databases, tables, and columns.'),
      privilegeType?: string(name='PrivilegeType', description='The permission level that you want to assign to the database account. You can call the `DescribeEnabledPrivileges` operation to query the permission level that can be assigned to the database account.', example='Global'),
      privileges?: [ string ](name='Privileges', description='The permissions that you want to grant to the database account.'),
    }
  ](name='AccountPrivileges', description='The permissions that you want to grant to the database account.

This parameter is required.'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp1k5p066e1a****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model ModifyAccountPrivilegesShrinkRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

This parameter is required.', example='account1'),
  accountPrivilegesShrink?: string(name='AccountPrivileges', description='The permissions that you want to grant to the database account.

This parameter is required.'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp1k5p066e1a****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model ModifyAccountPrivilegesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='9DD88DE7-824F-1082-AA57-575AFC6517A8'),
}

model ModifyAccountPrivilegesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountPrivilegesResponseBody(name='body'),
}

/**
 * @summary Modifies the permissions of a database account.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param tmpReq ModifyAccountPrivilegesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountPrivilegesResponse
 */
async function modifyAccountPrivilegesWithOptions(tmpReq: ModifyAccountPrivilegesRequest, runtime: Util.RuntimeOptions): ModifyAccountPrivilegesResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyAccountPrivilegesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.accountPrivileges)) {
    request.accountPrivilegesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.accountPrivileges, 'AccountPrivileges', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPrivilegesShrink)) {
    query['AccountPrivileges'] = request.accountPrivilegesShrink;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAccountPrivileges',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the permissions of a database account.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyAccountPrivilegesRequest
 * @return ModifyAccountPrivilegesResponse
 */
async function modifyAccountPrivileges(request: ModifyAccountPrivilegesRequest): ModifyAccountPrivilegesResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAccountPrivilegesWithOptions(request, runtime);
}

model ModifyApsDatasoureRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  datasourceDescription?: string(name='DatasourceDescription', description='The description of the data source.', example='test'),
  datasourceId?: long(name='DatasourceId', description='The data source ID.

This parameter is required.', example='1'),
  datasourceName?: string(name='DatasourceName', description='The name of the data source.', example='sls-******'),
  kafkaInfo?: {
    kafkaClusterId?: string(name='KafkaClusterId', description='The ID of the Kafka instance.', example='-'),
    kafkaTopic?: string(name='KafkaTopic', description='The topic of the Kafka instance.', example='test-topic'),
  }(name='KafkaInfo', description='The information about the Kafka instance.', example='-'),
  lakehouseId?: {
    securityGroup?: string(name='SecurityGroup', description='The name of the security group.', example='sg-******'),
    vpcId?: string(name='VpcId', description='The virtual private cloud (VPC) ID.', example='vpc-******'),
    vswitch?: string(name='Vswitch', description='The name of the vSwitch.', example='vsw-******'),
  }(name='LakehouseId', description='The lakehouse ID.', example='123'),
  polarDBMysqlInfo?: {
    connectUrl?: string(name='ConnectUrl', description='The parameter is no longer supported.', example='-'),
    password?: string(name='Password', description='The parameter is no longer supported.', example='-'),
    regionId?: string(name='RegionId', description='The parameter is no longer supported.', example='-'),
    userName?: string(name='UserName', description='The parameter is no longer supported.', example='-'),
  }(name='PolarDBMysqlInfo', description='The parameter is no longer supported.', example='-'),
  rdsMysqlInfo?: {
    connectUrl?: string(name='ConnectUrl', description='The parameter is no longer supported.', example='-'),
    password?: string(name='Password', description='The parameter is no longer supported.', example='-'),
    regionId?: string(name='RegionId', description='The parameter is no longer supported.', example='-'),
    userName?: string(name='UserName', description='The parameter is no longer supported.', example='-'),
  }(name='RdsMysqlInfo', description='The parameter is no longer supported.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-shanghai'),
  slsInfo?: {
    across?: boolean(name='Across', description='Specifies whether to use a cross-account resource as the data source. Valid values:

*   **true**
*   **false**', example='false'),
    acrossRole?: string(name='AcrossRole', description='The name of the cross-account role.', example='test-role'),
    acrossUid?: string(name='AcrossUid', description='The cross-account UID.', example='123456'),
    sourceRegionId?: string(name='SourceRegionId', description='The region ID.', example='cn-beijing'),
  }(name='SlsInfo', description='The information about Simple Log Service (SLS).', example='-'),
}

model ModifyApsDatasoureShrinkRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  datasourceDescription?: string(name='DatasourceDescription', description='The description of the data source.', example='test'),
  datasourceId?: long(name='DatasourceId', description='The data source ID.

This parameter is required.', example='1'),
  datasourceName?: string(name='DatasourceName', description='The name of the data source.', example='sls-******'),
  kafkaInfoShrink?: string(name='KafkaInfo', description='The information about the Kafka instance.', example='-'),
  lakehouseIdShrink?: string(name='LakehouseId', description='The lakehouse ID.', example='123'),
  polarDBMysqlInfoShrink?: string(name='PolarDBMysqlInfo', description='The parameter is no longer supported.', example='-'),
  rdsMysqlInfoShrink?: string(name='RdsMysqlInfo', description='The parameter is no longer supported.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-shanghai'),
  slsInfoShrink?: string(name='SlsInfo', description='The information about Simple Log Service (SLS).', example='-'),
}

model ModifyApsDatasoureResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  data?: string(name='Data', description='The returned data.', example='150'),
  httpStatusCode?: string(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='A3EB3BCD-D974-52D4-B75C-BB06505916CB'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
}

model ModifyApsDatasoureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyApsDatasoureResponseBody(name='body'),
}

/**
 * @summary Modifies an AnalyticDB Pipeline Service (APS) data source.
 *
 * @description ### [](#)
 * *   You can call this operation only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   You cannot modify the number of nodes for the USER_DEFAULT resource group.
 *
 * @param tmpReq ModifyApsDatasoureRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyApsDatasoureResponse
 */
async function modifyApsDatasoureWithOptions(tmpReq: ModifyApsDatasoureRequest, runtime: Util.RuntimeOptions): ModifyApsDatasoureResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyApsDatasoureShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.kafkaInfo)) {
    request.kafkaInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.kafkaInfo, 'KafkaInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.lakehouseId)) {
    request.lakehouseIdShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.lakehouseId, 'LakehouseId', 'json');
  }
  if (!Util.isUnset(tmpReq.polarDBMysqlInfo)) {
    request.polarDBMysqlInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.polarDBMysqlInfo, 'PolarDBMysqlInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.rdsMysqlInfo)) {
    request.rdsMysqlInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rdsMysqlInfo, 'RdsMysqlInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.slsInfo)) {
    request.slsInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.slsInfo, 'SlsInfo', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.datasourceDescription)) {
    body['DatasourceDescription'] = request.datasourceDescription;
  }
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.datasourceName)) {
    body['DatasourceName'] = request.datasourceName;
  }
  if (!Util.isUnset(request.kafkaInfoShrink)) {
    body['KafkaInfo'] = request.kafkaInfoShrink;
  }
  if (!Util.isUnset(request.lakehouseIdShrink)) {
    body['LakehouseId'] = request.lakehouseIdShrink;
  }
  if (!Util.isUnset(request.polarDBMysqlInfoShrink)) {
    body['PolarDBMysqlInfo'] = request.polarDBMysqlInfoShrink;
  }
  if (!Util.isUnset(request.rdsMysqlInfoShrink)) {
    body['RdsMysqlInfo'] = request.rdsMysqlInfoShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.slsInfoShrink)) {
    body['SlsInfo'] = request.slsInfoShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApsDatasoure',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an AnalyticDB Pipeline Service (APS) data source.
 *
 * @description ### [](#)
 * *   You can call this operation only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   You cannot modify the number of nodes for the USER_DEFAULT resource group.
 *
 * @param request ModifyApsDatasoureRequest
 * @return ModifyApsDatasoureResponse
 */
async function modifyApsDatasoure(request: ModifyApsDatasoureRequest): ModifyApsDatasoureResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApsDatasoureWithOptions(request, runtime);
}

model ModifyApsJobRequest {
  apsJobId?: string(name='ApsJobId', description='The job ID.

This parameter is required.', example='aps-bj1xxxxxx'),
  dbList?: string(name='DbList', description='The objects to be synchronized.

This parameter is required.', example='{"EntireInstance":true}'),
  partitionList?: string(name='PartitionList', description='The partitions.', example='{}'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model ModifyApsJobResponseBody = {
  apsJobId?: string(name='ApsJobId', description='The job ID.', example='aps-bj1xxxxxx'),
  code?: string(name='Code', description='The status code. A value of 200 indicates that the request is successful.', example='InvalidInput'),
  errCode?: string(name='ErrCode', description='The error code.', example='Success'),
  errMessage?: string(name='ErrMessage', description='The error message returned if the request failed.', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The status code. A value of 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
}

model ModifyApsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyApsJobResponseBody(name='body'),
}

/**
 * @summary Modifies an AnalyticDB Pipeline Service (APS) job.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyApsJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyApsJobResponse
 */
async function modifyApsJobWithOptions(request: ModifyApsJobRequest, runtime: Util.RuntimeOptions): ModifyApsJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apsJobId)) {
    body['ApsJobId'] = request.apsJobId;
  }
  if (!Util.isUnset(request.dbList)) {
    body['DbList'] = request.dbList;
  }
  if (!Util.isUnset(request.partitionList)) {
    body['PartitionList'] = request.partitionList;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApsJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an AnalyticDB Pipeline Service (APS) job.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyApsJobRequest
 * @return ModifyApsJobResponse
 */
async function modifyApsJob(request: ModifyApsJobRequest): ModifyApsJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApsJobWithOptions(request, runtime);
}

model ModifyApsSlsADBJobRequest {
  columns?: [ 
    {
      mapName?: string(name='MapName', description='The name of the mapping.', example='map_name'),
      mapType?: string(name='MapType', description='The type of the mapping.', example='bigint'),
      name?: string(name='Name', description='The name of the column.', example='test_name'),
      type?: string(name='Type', description='The data type of the column.', example='bigint'),
    }
  ](name='Columns', description='The information about columns.', example='-'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  dbName?: string(name='DbName', description='The name of the database.', example='dbName'),
  dirtyDataProcessPattern?: string(name='DirtyDataProcessPattern', description='The dirty data processing mode.', example='STOP'),
  exactlyOnce?: string(name='ExactlyOnce', description='Specifies whether to enable the consistency check.', example='true'),
  password?: string(name='Password', description='The password of the database account.', example='test_123'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startingOffsets?: string(name='StartingOffsets', description='The start offset.', example='end_cursor'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
  unixTimestampConvert?: string(name='UnixTimestampConvert', description='The timestamp conversion.', example='-'),
  userName?: string(name='UserName', description='The name of the database account.', example='user-name'),
  workloadId?: string(name='WorkloadId', description='The job ID.

This parameter is required.', example='aps-******'),
  workloadName?: string(name='WorkloadName', description='The name of the workload.', example='test-name'),
}

model ModifyApsSlsADBJobShrinkRequest {
  columnsShrink?: string(name='Columns', description='The information about columns.', example='-'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  dbName?: string(name='DbName', description='The name of the database.', example='dbName'),
  dirtyDataProcessPattern?: string(name='DirtyDataProcessPattern', description='The dirty data processing mode.', example='STOP'),
  exactlyOnce?: string(name='ExactlyOnce', description='Specifies whether to enable the consistency check.', example='true'),
  password?: string(name='Password', description='The password of the database account.', example='test_123'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startingOffsets?: string(name='StartingOffsets', description='The start offset.', example='end_cursor'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
  unixTimestampConvert?: string(name='UnixTimestampConvert', description='The timestamp conversion.', example='-'),
  userName?: string(name='UserName', description='The name of the database account.', example='user-name'),
  workloadId?: string(name='WorkloadId', description='The job ID.

This parameter is required.', example='aps-******'),
  workloadName?: string(name='WorkloadName', description='The name of the workload.', example='test-name'),
}

model ModifyApsSlsADBJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  data?: map[string]any(name='Data', description='The returned data.', example='-'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model ModifyApsSlsADBJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyApsSlsADBJobResponseBody(name='body'),
}

/**
 * @summary Modifies an AnalyticDB Pipeline Service (APS) job from Simple Log Service (SLS) to an AnalyticDB for MySQL Data Warehouse Edition cluster.
 *
 * @param tmpReq ModifyApsSlsADBJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyApsSlsADBJobResponse
 */
async function modifyApsSlsADBJobWithOptions(tmpReq: ModifyApsSlsADBJobRequest, runtime: Util.RuntimeOptions): ModifyApsSlsADBJobResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyApsSlsADBJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.columns)) {
    request.columnsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.columns, 'Columns', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.columnsShrink)) {
    body['Columns'] = request.columnsShrink;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dirtyDataProcessPattern)) {
    body['DirtyDataProcessPattern'] = request.dirtyDataProcessPattern;
  }
  if (!Util.isUnset(request.exactlyOnce)) {
    body['ExactlyOnce'] = request.exactlyOnce;
  }
  if (!Util.isUnset(request.password)) {
    body['Password'] = request.password;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startingOffsets)) {
    body['StartingOffsets'] = request.startingOffsets;
  }
  if (!Util.isUnset(request.tableName)) {
    body['TableName'] = request.tableName;
  }
  if (!Util.isUnset(request.unixTimestampConvert)) {
    body['UnixTimestampConvert'] = request.unixTimestampConvert;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.workloadId)) {
    body['WorkloadId'] = request.workloadId;
  }
  if (!Util.isUnset(request.workloadName)) {
    body['WorkloadName'] = request.workloadName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApsSlsADBJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an AnalyticDB Pipeline Service (APS) job from Simple Log Service (SLS) to an AnalyticDB for MySQL Data Warehouse Edition cluster.
 *
 * @param request ModifyApsSlsADBJobRequest
 * @return ModifyApsSlsADBJobResponse
 */
async function modifyApsSlsADBJob(request: ModifyApsSlsADBJobRequest): ModifyApsSlsADBJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApsSlsADBJobWithOptions(request, runtime);
}

model ModifyApsWorkloadNameRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-*******'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  workloadId?: string(name='WorkloadId', description='The job ID.

This parameter is required.', example='aps-******'),
  workloadName?: string(name='WorkloadName', description='The name of the workload.

This parameter is required.', example='sls-2024***93014'),
}

model ModifyApsWorkloadNameResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='InvalidInput'),
  data?: string(name='Data', description='The returned data.', example='123'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The status code. A value of 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
}

model ModifyApsWorkloadNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyApsWorkloadNameResponseBody(name='body'),
}

/**
 * @summary Modifies the AnalyticDB Pipeline Service (APS) workload name.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyApsWorkloadNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyApsWorkloadNameResponse
 */
async function modifyApsWorkloadNameWithOptions(request: ModifyApsWorkloadNameRequest, runtime: Util.RuntimeOptions): ModifyApsWorkloadNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.workloadId)) {
    body['WorkloadId'] = request.workloadId;
  }
  if (!Util.isUnset(request.workloadName)) {
    body['WorkloadName'] = request.workloadName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApsWorkloadName',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the AnalyticDB Pipeline Service (APS) workload name.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyApsWorkloadNameRequest
 * @return ModifyApsWorkloadNameResponse
 */
async function modifyApsWorkloadName(request: ModifyApsWorkloadNameRequest): ModifyApsWorkloadNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApsWorkloadNameWithOptions(request, runtime);
}

model ModifyAuditLogConfigRequest {
  auditLogStatus?: string(name='AuditLogStatus', description='The status to which you want to change the SQL audit feature. Valid values:

*   **on**
*   **off**

>  After you disable the SQL audit feature, all SQL audit logs are deleted. You must query and export SQL audit logs before you disable SQL audit. For more information, see [DescribeAuditLogRecords](https://help.aliyun.com/document_detail/612426.html). When you re-enable SQL audit, audit logs that are generated from the time when SQL audit was last enabled are available for queries.

This parameter is required.', example='on'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-t4nj8619bz2w3****'),
  engineType?: string(name='EngineType', description='The type of the compute engine. Valid values:

*   XIHE (**default**)
*   SPARK', example='XIHE'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyAuditLogConfigResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='CDC59E56-BD07-56CA-A05F-B7907DE5C862'),
  updateSucceed?: boolean(name='UpdateSucceed', description='Indicates whether the status of SQL audit is updated. Valid values:

*   **true**
*   **false**', example='true'),
}

model ModifyAuditLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAuditLogConfigResponseBody(name='body'),
}

/**
 * @summary Modifies the SQL audit settings of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyAuditLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAuditLogConfigResponse
 */
async function modifyAuditLogConfigWithOptions(request: ModifyAuditLogConfigRequest, runtime: Util.RuntimeOptions): ModifyAuditLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.auditLogStatus)) {
    query['AuditLogStatus'] = request.auditLogStatus;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engineType)) {
    query['EngineType'] = request.engineType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAuditLogConfig',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the SQL audit settings of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyAuditLogConfigRequest
 * @return ModifyAuditLogConfigResponse
 */
async function modifyAuditLogConfig(request: ModifyAuditLogConfigRequest): ModifyAuditLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAuditLogConfigWithOptions(request, runtime);
}

model ModifyBackupPolicyRequest {
  backupRetentionPeriod?: string(name='BackupRetentionPeriod', description='The number of days for which to retain full backup files. Valid values: 7 to 730.

>  If you do not specify this parameter, the default value 7 is used.', example='7'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  enableBackupLog?: string(name='EnableBackupLog', description='Specifies whether to enable log backup. Valid values:

*   **Enable**
*   **Disable**

>  If you do not specify this parameter, the default value Enable is used.', example='Enable'),
  logBackupRetentionPeriod?: int32(name='LogBackupRetentionPeriod', description='The number of days for which to retain log backup files. Valid values: 7 to 730.

>  If you do not specify this parameter, the default value 7 is used.', example='7'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The days of the week on which to perform a full backup. Separate multiple values with commas (,). Valid values:

*   **Monday**
*   **Tuesday**
*   **Wednesday**
*   **Thursday**
*   **Friday**
*   **Saturday**
*   **Sunday**

>  To ensure data security, we recommend that you specify at least two values.', example='Monday,Wednesday,Friday,Sunday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The start time to perform a full backup. Specify the time in the HH:mmZ-HH:mmZ format. The time must be in UTC.

>  The time range must be 1 hour.

This parameter is required.', example='18:00Z-19:00Z'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyBackupPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyBackupPolicyResponseBody(name='body'),
}

/**
 * @summary Modifies the backup policy of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicyWithOptions(request: ModifyBackupPolicyRequest, runtime: Util.RuntimeOptions): ModifyBackupPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupRetentionPeriod)) {
    query['BackupRetentionPeriod'] = request.backupRetentionPeriod;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableBackupLog)) {
    query['EnableBackupLog'] = request.enableBackupLog;
  }
  if (!Util.isUnset(request.logBackupRetentionPeriod)) {
    query['LogBackupRetentionPeriod'] = request.logBackupRetentionPeriod;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.preferredBackupPeriod)) {
    query['PreferredBackupPeriod'] = request.preferredBackupPeriod;
  }
  if (!Util.isUnset(request.preferredBackupTime)) {
    query['PreferredBackupTime'] = request.preferredBackupTime;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyBackupPolicy',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the backup policy of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyBackupPolicyRequest
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicy(request: ModifyBackupPolicyRequest): ModifyBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupPolicyWithOptions(request, runtime);
}

model ModifyClickhouseEngineRequest {
  cacheSize?: int32(name='CacheSize', description='The disk cache size of the wide table engine. Unit: GB. Default value: 100. Valid values: 100 to 1000.', example='200'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp11q28kvl688****'),
  enabled?: boolean(name='Enabled', description='Specifies whether to enable the wide table engine feature. Valid values:

- true

- false', example='true'),
  ownerId?: string(name='OwnerId'),
}

model ModifyClickhouseEngineResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D761DA51-12F8-5457-AAA9-F52B9F436D2D'),
}

model ModifyClickhouseEngineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyClickhouseEngineResponseBody(name='body'),
}

/**
 * @summary Enables the wide table engine feature for an AnalyticDB for MySQL cluster or modifies the disk cache size of the wide table engine of an AnalyticDB for MySQL cluster for which you enabled the wide table engine feature.
 *
 * @param request ModifyClickhouseEngineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyClickhouseEngineResponse
 */
async function modifyClickhouseEngineWithOptions(request: ModifyClickhouseEngineRequest, runtime: Util.RuntimeOptions): ModifyClickhouseEngineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cacheSize)) {
    query['CacheSize'] = request.cacheSize;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyClickhouseEngine',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables the wide table engine feature for an AnalyticDB for MySQL cluster or modifies the disk cache size of the wide table engine of an AnalyticDB for MySQL cluster for which you enabled the wide table engine feature.
 *
 * @param request ModifyClickhouseEngineRequest
 * @return ModifyClickhouseEngineResponse
 */
async function modifyClickhouseEngine(request: ModifyClickhouseEngineRequest): ModifyClickhouseEngineResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyClickhouseEngineWithOptions(request, runtime);
}

model ModifyClusterAccessWhiteListRequest {
  DBClusterIPArrayAttribute?: string(name='DBClusterIPArrayAttribute', description='The attribute of the IP address whitelist. By default, this parameter is empty.

> Whitelists with the hidden attribute are not displayed in the console. Those whitelists are used to access Data Transmission Service (DTS) and PolarDB.', example='hidden'),
  DBClusterIPArrayName?: string(name='DBClusterIPArrayName', description='The name of the IP address whitelist. If you do not specify this parameter, the Default whitelist is modified.

*   The whitelist name must be 2 to 32 characters in length. The name can contain lowercase letters, digits, and underscores (_). The name must start with a lowercase letter and end with a lowercase letter or a digit.
*   Each cluster supports up to 50 IP address whitelists.', example='test'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  modifyMode?: string(name='ModifyMode', description='The method used to modify the IP address whitelist. Valid values:

*   **Cover** (default)
*   **Append**
*   **Delete**', example='Cover'),
  securityIps?: string(name='SecurityIps', description='The IP addresses in an IP address whitelist of a cluster. Separate multiple IP addresses with commas (,). You can add a maximum of 500 different IP addresses to a whitelist. The entries in the IP address whitelist must be in one of the following formats:

*   IP addresses, such as 10.23.XX.XX.
*   CIDR blocks, such as 10.23.xx.xx/24. In this example, 24 indicates that the prefix of each IP address in the IP whitelist is 24 bits in length. You can replace 24 with a value within the range of 1 to 32.

This parameter is required.', example='10.23.xx.xx'),
}

model ModifyClusterAccessWhiteListResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp11q28kvl688****'),
  requestId?: string(name='RequestId', description='The request ID.', example='370D09FD-442A-5225-AAD3-7362CAE39177'),
  taskId?: int32(name='TaskId', description='The task ID.', example='1564657730'),
}

model ModifyClusterAccessWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyClusterAccessWhiteListResponseBody(name='body'),
}

/**
 * @summary Modifies the IP address whitelist of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request ModifyClusterAccessWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyClusterAccessWhiteListResponse
 */
async function modifyClusterAccessWhiteListWithOptions(request: ModifyClusterAccessWhiteListRequest, runtime: Util.RuntimeOptions): ModifyClusterAccessWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterIPArrayAttribute)) {
    query['DBClusterIPArrayAttribute'] = request.DBClusterIPArrayAttribute;
  }
  if (!Util.isUnset(request.DBClusterIPArrayName)) {
    query['DBClusterIPArrayName'] = request.DBClusterIPArrayName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.modifyMode)) {
    query['ModifyMode'] = request.modifyMode;
  }
  if (!Util.isUnset(request.securityIps)) {
    query['SecurityIps'] = request.securityIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyClusterAccessWhiteList',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the IP address whitelist of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request ModifyClusterAccessWhiteListRequest
 * @return ModifyClusterAccessWhiteListResponse
 */
async function modifyClusterAccessWhiteList(request: ModifyClusterAccessWhiteListRequest): ModifyClusterAccessWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyClusterAccessWhiteListWithOptions(request, runtime);
}

model ModifyClusterConnectionStringRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the public endpoint.

*   The prefix can contain lowercase letters, digits, and hyphens (-). It must start with a lowercase letter.
*   The prefix can be up to 30 characters in length.

This parameter is required.', example='test-123'),
  currentConnectionString?: string(name='CurrentConnectionString', description='The public endpoint of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****.ads.aliyuncs.com'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  port?: int32(name='Port', description='The port number. Set the value to **3306**.', example='3306'),
}

model ModifyClusterConnectionStringResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='370D09FD-442A-5225-AAD3-7362CAE39177'),
}

model ModifyClusterConnectionStringResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyClusterConnectionStringResponseBody(name='body'),
}

/**
 * @summary Modifies the public endpoint of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyClusterConnectionStringRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyClusterConnectionStringResponse
 */
async function modifyClusterConnectionStringWithOptions(request: ModifyClusterConnectionStringRequest, runtime: Util.RuntimeOptions): ModifyClusterConnectionStringResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!Util.isUnset(request.currentConnectionString)) {
    query['CurrentConnectionString'] = request.currentConnectionString;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.port)) {
    query['Port'] = request.port;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyClusterConnectionString',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the public endpoint of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyClusterConnectionStringRequest
 * @return ModifyClusterConnectionStringResponse
 */
async function modifyClusterConnectionString(request: ModifyClusterConnectionStringRequest): ModifyClusterConnectionStringResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyClusterConnectionStringWithOptions(request, runtime);
}

model ModifyCompactionServiceSwitchRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp14t95lun0w****'),
  enableCompactionService?: boolean(name='EnableCompactionService', description='Specifies whether to enable the remote build feature.

Valid values:

*   true
*   false

This parameter is required.', example='true'),
}

model ModifyCompactionServiceSwitchResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='21ABF219-10E0-571B-94B8-9C9AE5022BF8'),
}

model ModifyCompactionServiceSwitchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCompactionServiceSwitchResponseBody(name='body'),
}

/**
 * @summary Modifies the status of the remote build feature in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyCompactionServiceSwitchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCompactionServiceSwitchResponse
 */
async function modifyCompactionServiceSwitchWithOptions(request: ModifyCompactionServiceSwitchRequest, runtime: Util.RuntimeOptions): ModifyCompactionServiceSwitchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableCompactionService)) {
    query['EnableCompactionService'] = request.enableCompactionService;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyCompactionServiceSwitch',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the status of the remote build feature in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyCompactionServiceSwitchRequest
 * @return ModifyCompactionServiceSwitchResponse
 */
async function modifyCompactionServiceSwitch(request: ModifyCompactionServiceSwitchRequest): ModifyCompactionServiceSwitchResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyCompactionServiceSwitchWithOptions(request, runtime);
}

model ModifyDBClusterRequest {
  computeResource?: string(name='ComputeResource', description='The reserved computing resources. Valid values: 0ACU to 4096ACU. The value must be in increments of 16ACU. Each ACU is approximately equal to 1 core and 4 GB memory.

>  This parameter must be specified with a unit.', example='16ACU'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-bp1r053byu48p****'),
  enableDefaultResourcePool?: boolean(name='EnableDefaultResourcePool', description='Specifies whether to allocate all reserved computing resources to the user_default resource group. Valid values:

*   true (default)
*   false', example='true'),
  productForm?: string(name='ProductForm', example='LegacyForm'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.', example='cn-hangzhou'),
  reservedNodeCount?: int32(name='ReservedNodeCount'),
  reservedNodeSize?: string(name='ReservedNodeSize', example='LegacyForm'),
  storageResource?: string(name='StorageResource', description='The reserved storage resources. Valid values: 0ACU to 2064ACU. The value must be in increments of 24ACU. Each ACU is approximately equal to 1 core and 4 GB memory.

>  This parameter must be specified with a unit.', example='24ACU'),
}

model ModifyDBClusterResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.', example='amv-bp1r053byu48p****'),
  orderId?: string(name='OrderId', description='The order ID.', example='2035629****'),
  requestId?: string(name='RequestId', description='The request ID.', example='0D6BF3E2-41D8-57F6-9A62-A13A70377952'),
}

model ModifyDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterResponseBody(name='body'),
}

/**
 * @summary Changes the configurations of an AnalyticDB for MySQL Data Lakehouse Edition cluster.
 *
 * @description ### [](#)
 * *   During a scaling event, you are not allowed to execute the `SUBMIT JOB` statement to submit asynchronous jobs. If your business requires asynchronous jobs, perform scaling during appropriate periods.
 * *   When you scale a cluster, data in the cluster is migrated for redistribution. The amount of time that is required to migrate data is proportional to the data volume. During a scaling event, the services provided by the cluster are not interrupted. When you downgrade cluster specifications, data migration may require up to dozens of hours to complete. Proceed with caution especially if your cluster contains a large amount of data.
 * *   If the cluster has a built-in dataset loaded, make sure that the cluster has reserved storage resources of at least 24 AnalyticDB compute units (ACUs). Otherwise, the built-in dataset cannot be used.
 * *   When the scaling process is about to end, transient connections may occur. We recommend that you scale your cluster during off-peak hours or make sure that your application is configured to automatically reconnect to your cluster.
 * *   You can change an AnalyticDB for MySQL cluster from Data Warehouse Edition to Data Lakehouse Edition, but not the other way around. For more information, see Change a cluster from Data Warehouse Edition to Data Lakehouse Edition.
 * *   For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterResponse
 */
async function modifyDBClusterWithOptions(request: ModifyDBClusterRequest, runtime: Util.RuntimeOptions): ModifyDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.computeResource)) {
    query['ComputeResource'] = request.computeResource;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableDefaultResourcePool)) {
    query['EnableDefaultResourcePool'] = request.enableDefaultResourcePool;
  }
  if (!Util.isUnset(request.productForm)) {
    query['ProductForm'] = request.productForm;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.reservedNodeCount)) {
    query['ReservedNodeCount'] = request.reservedNodeCount;
  }
  if (!Util.isUnset(request.reservedNodeSize)) {
    query['ReservedNodeSize'] = request.reservedNodeSize;
  }
  if (!Util.isUnset(request.storageResource)) {
    query['StorageResource'] = request.storageResource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBCluster',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the configurations of an AnalyticDB for MySQL Data Lakehouse Edition cluster.
 *
 * @description ### [](#)
 * *   During a scaling event, you are not allowed to execute the `SUBMIT JOB` statement to submit asynchronous jobs. If your business requires asynchronous jobs, perform scaling during appropriate periods.
 * *   When you scale a cluster, data in the cluster is migrated for redistribution. The amount of time that is required to migrate data is proportional to the data volume. During a scaling event, the services provided by the cluster are not interrupted. When you downgrade cluster specifications, data migration may require up to dozens of hours to complete. Proceed with caution especially if your cluster contains a large amount of data.
 * *   If the cluster has a built-in dataset loaded, make sure that the cluster has reserved storage resources of at least 24 AnalyticDB compute units (ACUs). Otherwise, the built-in dataset cannot be used.
 * *   When the scaling process is about to end, transient connections may occur. We recommend that you scale your cluster during off-peak hours or make sure that your application is configured to automatically reconnect to your cluster.
 * *   You can change an AnalyticDB for MySQL cluster from Data Warehouse Edition to Data Lakehouse Edition, but not the other way around. For more information, see Change a cluster from Data Warehouse Edition to Data Lakehouse Edition.
 * *   For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyDBClusterRequest
 * @return ModifyDBClusterResponse
 */
async function modifyDBCluster(request: ModifyDBClusterRequest): ModifyDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterWithOptions(request, runtime);
}

model ModifyDBClusterDescriptionRequest {
  DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.

*   The description cannot start with `http://` or `https`.
*   The description must be 2 to 256 characters in length.

This parameter is required.', example='adb_test'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp1r053byu48p****'),
}

model ModifyDBClusterDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='17F57FEE-EA4F-4337-8D2E-9C23CAA63D74'),
}

model ModifyDBClusterDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterDescriptionResponseBody(name='body'),
}

/**
 * @summary Modifies the description of an AnalyticDB for MySQL cluster to facilitate the maintenance and management of the cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyDBClusterDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterDescriptionResponse
 */
async function modifyDBClusterDescriptionWithOptions(request: ModifyDBClusterDescriptionRequest, runtime: Util.RuntimeOptions): ModifyDBClusterDescriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterDescription)) {
    query['DBClusterDescription'] = request.DBClusterDescription;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterDescription',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the description of an AnalyticDB for MySQL cluster to facilitate the maintenance and management of the cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyDBClusterDescriptionRequest
 * @return ModifyDBClusterDescriptionResponse
 */
async function modifyDBClusterDescription(request: ModifyDBClusterDescriptionRequest): ModifyDBClusterDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterDescriptionWithOptions(request, runtime);
}

model ModifyDBClusterMaintainTimeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp1r053byu48p****'),
  maintainTime?: string(name='MaintainTime', description='The maintenance window of the cluster. It must be in the hh:mmZ-hh:mmZ format.

> The interval must be 1 hour and start and end at the beginning of an hour.

This parameter is required.', example='22:00Z-23:00Z'),
}

model ModifyDBClusterMaintainTimeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='65BDA532-28AF-4122-AA39-B382721EEE64'),
}

model ModifyDBClusterMaintainTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterMaintainTimeResponseBody(name='body'),
}

/**
 * @summary Modifies the maintenance window of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyDBClusterMaintainTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterMaintainTimeResponse
 */
async function modifyDBClusterMaintainTimeWithOptions(request: ModifyDBClusterMaintainTimeRequest, runtime: Util.RuntimeOptions): ModifyDBClusterMaintainTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.maintainTime)) {
    query['MaintainTime'] = request.maintainTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterMaintainTime',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the maintenance window of an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyDBClusterMaintainTimeRequest
 * @return ModifyDBClusterMaintainTimeResponse
 */
async function modifyDBClusterMaintainTime(request: ModifyDBClusterMaintainTimeRequest): ModifyDBClusterMaintainTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterMaintainTimeWithOptions(request, runtime);
}

model ModifyDBClusterResourceGroupRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bpxxxxx'),
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the resource group to which you want to move the AnalyticDB for MySQL cluster.

>  You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management within a single Alibaba Cloud account. For more information, see [What is Resource Management?](https://help.aliyun.com/document_detail/94475.html)

This parameter is required.', example='rg-acxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBClusterResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='65BDA532-28AF-4122-AA39-B382721EEE64'),
}

model ModifyDBClusterResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterResourceGroupResponseBody(name='body'),
}

/**
 * @summary Changes the resource group to which an AnalyticDB for MySQL cluster belongs.
 *
 * @param request ModifyDBClusterResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterResourceGroupResponse
 */
async function modifyDBClusterResourceGroupWithOptions(request: ModifyDBClusterResourceGroupRequest, runtime: Util.RuntimeOptions): ModifyDBClusterResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterResourceGroup',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the resource group to which an AnalyticDB for MySQL cluster belongs.
 *
 * @param request ModifyDBClusterResourceGroupRequest
 * @return ModifyDBClusterResourceGroupResponse
 */
async function modifyDBClusterResourceGroup(request: ModifyDBClusterResourceGroupRequest): ModifyDBClusterResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterResourceGroupWithOptions(request, runtime);
}

model ModifyDBClusterVipRequest {
  connectString?: string(name='ConnectString', description='The endpoint of the cluster.', example='amv-2ze8mbuai974s4y2500000169.ads.aliyuncs.com'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region, including cluster IDs.

This parameter is required.', example='amv-2ze8mbuai97*****'),
  VPCId?: string(name='VPCId', description='The VPC ID.

> 

*   The new **VPC** must reside in the same region as the cluster.

This parameter is required.', example='vpc-bp1at5ze0t5u3xtqn****'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.

> 

*   The new vSwitch must reside in the same zone as the cluster.

This parameter is required.', example='vsw-bp1aadw9k19x6cis9****'),
}

model ModifyDBClusterVipResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-****-4A42-BF6D-8A4442913CEF'),
}

model ModifyDBClusterVipResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterVipResponseBody(name='body'),
}

/**
 * @summary Changes the virtual IP address (VIP) that is used to connect to an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterVipRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterVipResponse
 */
async function modifyDBClusterVipWithOptions(request: ModifyDBClusterVipRequest, runtime: Util.RuntimeOptions): ModifyDBClusterVipResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectString)) {
    query['ConnectString'] = request.connectString;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.VPCId)) {
    query['VPCId'] = request.VPCId;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterVip',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the virtual IP address (VIP) that is used to connect to an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterVipRequest
 * @return ModifyDBClusterVipResponse
 */
async function modifyDBClusterVip(request: ModifyDBClusterVipRequest): ModifyDBClusterVipResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterVipWithOptions(request, runtime);
}

model ModifyDBResourceGroupRequest {
  autoStopInterval?: string(name='AutoStopInterval', example='5m'),
  clusterMode?: string(name='ClusterMode', description='A reserved parameter.', example='N/A'),
  clusterSizeResource?: string(name='ClusterSizeResource', description='A reserved parameter.', example='N/A'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp1r053byu48p****'),
  enableSpot?: boolean(name='EnableSpot', description='Specifies whether to enable the spot instance feature for the resource group. After you enable the spot instance feature, you are charged for resources at a lower unit price but the resources are probably released. You can enable the spot instance feature only for job resource groups. Valid values:

*   **True**
*   **False**', example='true'),
  engineParams?: map[string]any(name='EngineParams', example='{\\\\"spark.adb.version\\\\":\\\\"3.5\\\\"}'),
  groupName?: string(name='GroupName', description='The name of the resource group.

> You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the name of a resource group in a cluster.

This parameter is required.', example='test'),
  groupType?: string(name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

> For information about resource groups of Data Lakehouse Edition, see [Resource groups](https://help.aliyun.com/document_detail/428610.html).

This parameter is required.', example='Interactive'),
  maxClusterCount?: int32(name='MaxClusterCount', description='A reserved parameter.', example='N/A'),
  maxComputeResource?: string(name='MaxComputeResource', description='The maximum amount of reserved computing resources.

*   If GroupType is set to Interactive, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 16ACU.
*   If GroupType is set to Job, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 8ACU.', example='48ACU'),
  maxGpuQuantity?: int32(name='MaxGpuQuantity'),
  minClusterCount?: int32(name='MinClusterCount', description='A reserved parameter.', example='N/A'),
  minComputeResource?: string(name='MinComputeResource', description='The minimum amount of reserved computing resources.

*   If the GroupType parameter is set to Interactive, set the value to 16ACU.
*   If GroupType is set to Job, set the value to 0ACU.', example='0ACU'),
  minGpuQuantity?: int32(name='MinGpuQuantity'),
  rayConfig?: {
    category?: string(name='Category'),
    headSpec?: string(name='HeadSpec'),
    workerGroups?: [ 
      {
        allocateUnit?: string(name='AllocateUnit'),
        groupName?: string(name='GroupName'),
        maxWorkerQuantity?: int32(name='MaxWorkerQuantity'),
        minWorkerQuantity?: int32(name='MinWorkerQuantity'),
        workerDiskCapacity?: string(name='WorkerDiskCapacity'),
        workerSpecName?: string(name='WorkerSpecName'),
        workerSpecType?: string(name='WorkerSpecType'),
      }
    ](name='WorkerGroups'),
  }(name='RayConfig'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.', example='cn-hangzhou'),
  rules?: [ 
    {
      groupName?: string(name='GroupName', description='The name of the resource group.', example='user_default'),
      queryTime?: string(name='QueryTime', description='The execution duration of the query. Unit: milliseconds.', example='180000'),
      targetGroupName?: string(name='TargetGroupName', description='The name of the destination resource group.', example='job'),
    }
  ](name='Rules', description='The job resubmission rules.'),
  specName?: string(name='SpecName'),
  status?: string(name='Status', example='starting'),
  targetResourceGroupName?: string(name='TargetResourceGroupName'),
}

model ModifyDBResourceGroupShrinkRequest {
  autoStopInterval?: string(name='AutoStopInterval', example='5m'),
  clusterMode?: string(name='ClusterMode', description='A reserved parameter.', example='N/A'),
  clusterSizeResource?: string(name='ClusterSizeResource', description='A reserved parameter.', example='N/A'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp1r053byu48p****'),
  enableSpot?: boolean(name='EnableSpot', description='Specifies whether to enable the spot instance feature for the resource group. After you enable the spot instance feature, you are charged for resources at a lower unit price but the resources are probably released. You can enable the spot instance feature only for job resource groups. Valid values:

*   **True**
*   **False**', example='true'),
  engineParamsShrink?: string(name='EngineParams', example='{\\\\"spark.adb.version\\\\":\\\\"3.5\\\\"}'),
  groupName?: string(name='GroupName', description='The name of the resource group.

> You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the name of a resource group in a cluster.

This parameter is required.', example='test'),
  groupType?: string(name='GroupType', description='The type of the resource group. Valid values:

*   **Interactive**
*   **Job**

> For information about resource groups of Data Lakehouse Edition, see [Resource groups](https://help.aliyun.com/document_detail/428610.html).

This parameter is required.', example='Interactive'),
  maxClusterCount?: int32(name='MaxClusterCount', description='A reserved parameter.', example='N/A'),
  maxComputeResource?: string(name='MaxComputeResource', description='The maximum amount of reserved computing resources.

*   If GroupType is set to Interactive, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 16ACU.
*   If GroupType is set to Job, the maximum amount of reserved computing resources refers to the amount of resources that are not allocated in the cluster. Set this parameter to a value in increments of 8ACU.', example='48ACU'),
  maxGpuQuantity?: int32(name='MaxGpuQuantity'),
  minClusterCount?: int32(name='MinClusterCount', description='A reserved parameter.', example='N/A'),
  minComputeResource?: string(name='MinComputeResource', description='The minimum amount of reserved computing resources.

*   If the GroupType parameter is set to Interactive, set the value to 16ACU.
*   If GroupType is set to Job, set the value to 0ACU.', example='0ACU'),
  minGpuQuantity?: int32(name='MinGpuQuantity'),
  rayConfigShrink?: string(name='RayConfig'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.', example='cn-hangzhou'),
  rulesShrink?: string(name='Rules', description='The job resubmission rules.'),
  specName?: string(name='SpecName'),
  status?: string(name='Status', example='starting'),
  targetResourceGroupName?: string(name='TargetResourceGroupName'),
}

model ModifyDBResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='805F14E1-0186-520E-A6D5-30188D94E8DA'),
}

model ModifyDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the amount of reserved computing resources for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param tmpReq ModifyDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBResourceGroupResponse
 */
async function modifyDBResourceGroupWithOptions(tmpReq: ModifyDBResourceGroupRequest, runtime: Util.RuntimeOptions): ModifyDBResourceGroupResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyDBResourceGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.engineParams)) {
    request.engineParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.engineParams, 'EngineParams', 'json');
  }
  if (!Util.isUnset(tmpReq.rayConfig)) {
    request.rayConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rayConfig, 'RayConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.rules)) {
    request.rulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rules, 'Rules', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.autoStopInterval)) {
    query['AutoStopInterval'] = request.autoStopInterval;
  }
  if (!Util.isUnset(request.clusterMode)) {
    query['ClusterMode'] = request.clusterMode;
  }
  if (!Util.isUnset(request.clusterSizeResource)) {
    query['ClusterSizeResource'] = request.clusterSizeResource;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableSpot)) {
    query['EnableSpot'] = request.enableSpot;
  }
  if (!Util.isUnset(request.engineParamsShrink)) {
    query['EngineParams'] = request.engineParamsShrink;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupType)) {
    query['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.maxClusterCount)) {
    query['MaxClusterCount'] = request.maxClusterCount;
  }
  if (!Util.isUnset(request.maxComputeResource)) {
    query['MaxComputeResource'] = request.maxComputeResource;
  }
  if (!Util.isUnset(request.maxGpuQuantity)) {
    query['MaxGpuQuantity'] = request.maxGpuQuantity;
  }
  if (!Util.isUnset(request.minClusterCount)) {
    query['MinClusterCount'] = request.minClusterCount;
  }
  if (!Util.isUnset(request.minComputeResource)) {
    query['MinComputeResource'] = request.minComputeResource;
  }
  if (!Util.isUnset(request.minGpuQuantity)) {
    query['MinGpuQuantity'] = request.minGpuQuantity;
  }
  if (!Util.isUnset(request.rayConfigShrink)) {
    query['RayConfig'] = request.rayConfigShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.rulesShrink)) {
    query['Rules'] = request.rulesShrink;
  }
  if (!Util.isUnset(request.specName)) {
    query['SpecName'] = request.specName;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.targetResourceGroupName)) {
    query['TargetResourceGroupName'] = request.targetResourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBResourceGroup',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the amount of reserved computing resources for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ModifyDBResourceGroupRequest
 * @return ModifyDBResourceGroupResponse
 */
async function modifyDBResourceGroup(request: ModifyDBResourceGroupRequest): ModifyDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBResourceGroupWithOptions(request, runtime);
}

model ModifyElasticPlanRequest {
  cronExpression?: string(name='CronExpression', description='A CORN expression that specifies the scaling cycle and time for the scaling plan.', example='0 20 14 * * ?'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-wz9509beptiz****'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

>  You can call the [DescribeElasticPlans](https://help.aliyun.com/document_detail/601334.html) operation to query the names of scaling plans.

This parameter is required.', example='test'),
  endTime?: string(name='EndTime', description='The end time of the scaling plan.

>  Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2025-01-01T12:01:00Z'),
  startTime?: string(name='StartTime', description='The start time of the scaling plan.

>  Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-01-01T12:01:00Z'),
  targetSize?: string(name='TargetSize', description='The desired specifications of elastic resources after scaling.

> 

*   If the scaling plan uses **EIUs** and **Default Proportional Scaling for EIUs** is enabled, you do not need to specify this parameter. In other cases, you must specify this parameter.

*   You can call the [DescribeElasticPlanSpecifications](https://help.aliyun.com/document_detail/601278.html) operation to query the specifications that are supported for scaling plans.', example='32ACU'),
}

model ModifyElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A5C433C2-001F-58E3-99F5-3274C14DF8BD'),
}

model ModifyElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyElasticPlanResponseBody(name='body'),
}

/**
 * @summary Modifies a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request ModifyElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyElasticPlanResponse
 */
async function modifyElasticPlanWithOptions(request: ModifyElasticPlanRequest, runtime: Util.RuntimeOptions): ModifyElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cronExpression)) {
    query['CronExpression'] = request.cronExpression;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.targetSize)) {
    query['TargetSize'] = request.targetSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyElasticPlan',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a scaling plan for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
 *
 * @param request ModifyElasticPlanRequest
 * @return ModifyElasticPlanResponse
 */
async function modifyElasticPlan(request: ModifyElasticPlanRequest): ModifyElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyElasticPlanWithOptions(request, runtime);
}

model ModifyEssdCacheConfigRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp10yt0gva71ei7d'),
  enableEssdCache?: boolean(name='EnableEssdCache', description='Specifies whether to enable the disk cache feature.

Valid values:

*   true
*   false

This parameter is required.', example='true'),
  essdCacheSize?: int32(name='EssdCacheSize', description='The disk cache size. Unit: GB.', example='500'),
}

model ModifyEssdCacheConfigResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='115F9CCA-EF2E-5F91-AB60-4961D52FEAB4'),
}

model ModifyEssdCacheConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyEssdCacheConfigResponseBody(name='body'),
}

/**
 * @summary Modifies the disk cache size in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyEssdCacheConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyEssdCacheConfigResponse
 */
async function modifyEssdCacheConfigWithOptions(request: ModifyEssdCacheConfigRequest, runtime: Util.RuntimeOptions): ModifyEssdCacheConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableEssdCache)) {
    query['EnableEssdCache'] = request.enableEssdCache;
  }
  if (!Util.isUnset(request.essdCacheSize)) {
    query['EssdCacheSize'] = request.essdCacheSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyEssdCacheConfig',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the disk cache size in the query acceleration configuration of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyEssdCacheConfigRequest
 * @return ModifyEssdCacheConfigResponse
 */
async function modifyEssdCacheConfig(request: ModifyEssdCacheConfigRequest): ModifyEssdCacheConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyEssdCacheConfigWithOptions(request, runtime);
}

model ModifyLakeCacheSizeRequest {
  capacity?: long(name='Capacity', description='The lake cache size that you want to set. Unit: GB.', example='100'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp10yt0gva71ei7d'),
  enableLakeCache?: boolean(name='EnableLakeCache', description='Specifies whether to enable the lake cache feature.

Valid values:

*   true
*   false

This parameter is required.', example='true'),
}

model ModifyLakeCacheSizeResponseBody = {
  code?: int32(name='Code', description='The status code. The value 200 indicates that the request is successful.', example='200'),
  data?: {
    capacity?: long(name='Capacity', description='The size of the lake cache space. Unit: GB.', example='100'),
    dataSize?: long(name='DataSize', description='The size of the data that occupies the lake cache space. Unit: GB.', example='100'),
    instances?: [ string ](name='Instances', description='The clusters that share the lake cache space.'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='494486CE-6F49-574E-B304-29127EA12E36'),
}

model ModifyLakeCacheSizeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyLakeCacheSizeResponseBody(name='body'),
}

/**
 * @summary Modifies the lake cache size of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyLakeCacheSizeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyLakeCacheSizeResponse
 */
async function modifyLakeCacheSizeWithOptions(request: ModifyLakeCacheSizeRequest, runtime: Util.RuntimeOptions): ModifyLakeCacheSizeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.capacity)) {
    query['Capacity'] = request.capacity;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableLakeCache)) {
    query['EnableLakeCache'] = request.enableLakeCache;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyLakeCacheSize',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the lake cache size of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyLakeCacheSizeRequest
 * @return ModifyLakeCacheSizeResponse
 */
async function modifyLakeCacheSize(request: ModifyLakeCacheSizeRequest): ModifyLakeCacheSizeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyLakeCacheSizeWithOptions(request, runtime);
}

model ModifyPerformanceViewRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp1ub9grke1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  viewDetail?: {
    categories?: [ 
      {
        category?: string(name='Category', description='The name of the metric category. Valid values:

*   **Node**
*   **DiskData**
*   **WorkLoad**
*   **ResourceGroup**', example='Node'),
        keys?: [ 
          {
            keyName?: string(name='KeyName', description='The name of the metric.', example='AnalyticDB_CPU'),
            selected?: boolean(name='Selected', description='Specifies whether to select the metric. Valid values:

*   true
*   false', example='true'),
          }
        ](name='Keys', description='The metrics.'),
      }
    ](name='Categories', description='The metric categories.'),
    chartLinked?: boolean(name='ChartLinked', description='Specifies whether to enable the filter interaction feature. Valid values:

*   true
*   false', example='true'),
    chartsPerLine?: int32(name='ChartsPerLine', description='The number of charts to display in each row.', example='3'),
  }(name='ViewDetail', description='The new information about the monitoring view.

This parameter is required.'),
  viewName?: string(name='ViewName', description='The name of the monitoring view.

This parameter is required.', example='Basic'),
}

model ModifyPerformanceViewShrinkRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612397.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp1ub9grke1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  viewDetailShrink?: string(name='ViewDetail', description='The new information about the monitoring view.

This parameter is required.'),
  viewName?: string(name='ViewName', description='The name of the monitoring view.

This parameter is required.', example='Basic'),
}

model ModifyPerformanceViewResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial. This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  modifyStatus?: string(name='ModifyStatus', description='The modification result. Valid values:

*   **SUCCESS**
*   **FAILED**', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7EDB8E4-9769-4233-88C7-DCA4C9******'),
}

model ModifyPerformanceViewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyPerformanceViewResponseBody(name='body'),
}

/**
 * @summary Modifies the information about a custom monitoring view.
 *
 * @param tmpReq ModifyPerformanceViewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyPerformanceViewResponse
 */
async function modifyPerformanceViewWithOptions(tmpReq: ModifyPerformanceViewRequest, runtime: Util.RuntimeOptions): ModifyPerformanceViewResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyPerformanceViewShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.viewDetail)) {
    request.viewDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.viewDetail, 'ViewDetail', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.viewDetailShrink)) {
    query['ViewDetail'] = request.viewDetailShrink;
  }
  if (!Util.isUnset(request.viewName)) {
    query['ViewName'] = request.viewName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyPerformanceView',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the information about a custom monitoring view.
 *
 * @param request ModifyPerformanceViewRequest
 * @return ModifyPerformanceViewResponse
 */
async function modifyPerformanceView(request: ModifyPerformanceViewRequest): ModifyPerformanceViewResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyPerformanceViewWithOptions(request, runtime);
}

model ModifyUserEniVswitchOptionsRequest {
  dbClusterId?: string(name='DbClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp11q28kvl688****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  vSwitchOptions?: string(name='VSwitchOptions', description='The vSwitches that you want to use. The vSwitches must reside in the same virtual private cloud (VPC) and zone as ENIs. You can specify up to three vSwitches. Separate multiple vSwitches with commas (,).

> 

*   The vSwitches that you specify overwrite the existing vSwitches that are connected to ENIs.

*   You can call the [DescribeDBClusterAttribute](https://help.aliyun.com/document_detail/612399.html) operation to query the network information about ENIs in a cluster.

This parameter is required.', example='vsw-rj9ixufmywqq98z******,vsw-rj95ij6wcz656v7******'),
}

model ModifyUserEniVswitchOptionsResponseBody = {
  code?: string(name='Code', description='The HTTP status code or the error code.', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model ModifyUserEniVswitchOptionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyUserEniVswitchOptionsResponseBody(name='body'),
}

/**
 * @summary Modifies the vSwitches that are connected to elastic network interfaces (ENIs).
 *
 * @param request ModifyUserEniVswitchOptionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyUserEniVswitchOptionsResponse
 */
async function modifyUserEniVswitchOptionsWithOptions(request: ModifyUserEniVswitchOptionsRequest, runtime: Util.RuntimeOptions): ModifyUserEniVswitchOptionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbClusterId)) {
    query['DbClusterId'] = request.dbClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.vSwitchOptions)) {
    body['VSwitchOptions'] = request.vSwitchOptions;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyUserEniVswitchOptions',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the vSwitches that are connected to elastic network interfaces (ENIs).
 *
 * @param request ModifyUserEniVswitchOptionsRequest
 * @return ModifyUserEniVswitchOptionsResponse
 */
async function modifyUserEniVswitchOptions(request: ModifyUserEniVswitchOptionsRequest): ModifyUserEniVswitchOptionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyUserEniVswitchOptionsWithOptions(request, runtime);
}

model PreloadSparkAppMetricsRequest {
  appId?: string(name='AppId', description='The Spark application ID.

This parameter is required.', example='s202204221525hzca7d8140000003'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.', example='amv-bp1mfe9qmsw1dzyg'),
}

model PreloadSparkAppMetricsResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The ID of the Spark application.', example='s202212181815shaccb8be0000253'),
    attemptId?: string(name='AttemptId', description='The retry ID of the Spark application.', example='s202301061000hz57d797b0000201-0001'),
    eventLogPath?: string(name='EventLogPath', description='The event log path.', example='oss://path/to/eventLog'),
    finished?: boolean(name='Finished', description='Indicates whether parsing is complete. Valid values:

*   true
*   false', example='True'),
    scanMetrics?: {
      outputRowsCount?: long(name='OutputRowsCount', description='The number of rows scanned.', example='1000'),
      totalReadFileSizeInByte?: long(name='TotalReadFileSizeInByte', description='The size of the scanned data. Unit: bytes.', example='10000'),
    }(name='ScanMetrics', description='The metrics.'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='84489769-3065-5A28-A4CB-977CD426F1C3'),
}

model PreloadSparkAppMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PreloadSparkAppMetricsResponseBody(name='body'),
}

/**
 * @summary Preloads metrics for a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request PreloadSparkAppMetricsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PreloadSparkAppMetricsResponse
 */
async function preloadSparkAppMetricsWithOptions(request: PreloadSparkAppMetricsRequest, runtime: Util.RuntimeOptions): PreloadSparkAppMetricsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PreloadSparkAppMetrics',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Preloads metrics for a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request PreloadSparkAppMetricsRequest
 * @return PreloadSparkAppMetricsResponse
 */
async function preloadSparkAppMetrics(request: PreloadSparkAppMetricsRequest): PreloadSparkAppMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  return preloadSparkAppMetricsWithOptions(request, runtime);
}

model ReleaseClusterPublicConnectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
}

model ReleaseClusterPublicConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A94B6C02-7BD4-5D67-9776-3AC8317E8DD5'),
}

model ReleaseClusterPublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseClusterPublicConnectionResponseBody(name='body'),
}

/**
 * @summary Releases the public endpoint of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ReleaseClusterPublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseClusterPublicConnectionResponse
 */
async function releaseClusterPublicConnectionWithOptions(request: ReleaseClusterPublicConnectionRequest, runtime: Util.RuntimeOptions): ReleaseClusterPublicConnectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseClusterPublicConnection',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Releases the public endpoint of an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ReleaseClusterPublicConnectionRequest
 * @return ReleaseClusterPublicConnectionResponse
 */
async function releaseClusterPublicConnection(request: ReleaseClusterPublicConnectionRequest): ReleaseClusterPublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseClusterPublicConnectionWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the database account.

*   The description cannot start with `http://` or `https://`.
*   The description must be 2 to 256 characters in length.', example='AccDesc'),
  accountName?: string(name='AccountName', description='The name of the database account.

>  You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/612430.html) operation to query the information about database accounts of an AnalyticDB for MySQL cluster, including database account names.

This parameter is required.', example='test_accout'),
  accountPassword?: string(name='AccountPassword', description='The password of the database account.

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   Special characters include `! @ # $ % ^ & * ( ) _ + - =`
*   The password must be 8 to 32 characters in length.

This parameter is required.', example='Test_accout1'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-bp11q28kvl688****'),
  engine?: string(name='Engine', description='The database engine of the cluster. Valid values:

*   **AnalyticDB** (default): the AnalyticDB for MySQL engine.
*   **Clickhouse**: the wide table engine.', example='Clickhouse'),
}

model ResetAccountPasswordResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ResetAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAccountPasswordResponseBody(name='body'),
}

/**
 * @summary Resets the password of a database account for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ResetAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: Util.RuntimeOptions): ResetAccountPasswordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetAccountPassword',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Resets the password of a database account for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request ResetAccountPasswordRequest
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model RevokeOperatorPermissionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp1mfe9qmsw1dzyg'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RevokeOperatorPermissionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model RevokeOperatorPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RevokeOperatorPermissionResponseBody(name='body'),
}

/**
 * @summary Revokes permissions from the service account of an AnalyticDB for MySQL cluster.
 *
 * @param request RevokeOperatorPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RevokeOperatorPermissionResponse
 */
async function revokeOperatorPermissionWithOptions(request: RevokeOperatorPermissionRequest, runtime: Util.RuntimeOptions): RevokeOperatorPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RevokeOperatorPermission',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Revokes permissions from the service account of an AnalyticDB for MySQL cluster.
 *
 * @param request RevokeOperatorPermissionRequest
 * @return RevokeOperatorPermissionResponse
 */
async function revokeOperatorPermission(request: RevokeOperatorPermissionRequest): RevokeOperatorPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return revokeOperatorPermissionWithOptions(request, runtime);
}

model SetSparkAppLogRootPathRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

This parameter is required.', example='am-dbclusterid'),
  ossLogPath?: string(name='OssLogPath', description='The path of Object Storage Service (OSS) logs.', example='oss://path/to/log'),
  useDefaultOss?: boolean(name='UseDefaultOss', description='Specifies whether to use the default OSS log path.', example='true'),
}

model SetSparkAppLogRootPathResponseBody = {
  data?: {
    defaultLogPath?: string(name='DefaultLogPath', description='The default log path.', example='oss://path/to/log'),
    isLogPathExists?: boolean(name='IsLogPathExists', description='Indicates whether a log path exists.', example='true'),
    modifiedTimestamp?: string(name='ModifiedTimestamp', description='The last modification time.', example='1675236908'),
    modifiedUid?: string(name='ModifiedUid', description='The modifier ID.', example='1111111'),
    recordedLogPath?: string(name='RecordedLogPath', description='The recorded log path.', example='oss://path/to/log'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model SetSparkAppLogRootPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetSparkAppLogRootPathResponseBody(name='body'),
}

/**
 * @summary Modifies the Spark log configuration.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request SetSparkAppLogRootPathRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetSparkAppLogRootPathResponse
 */
async function setSparkAppLogRootPathWithOptions(request: SetSparkAppLogRootPathRequest, runtime: Util.RuntimeOptions): SetSparkAppLogRootPathResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ossLogPath)) {
    body['OssLogPath'] = request.ossLogPath;
  }
  if (!Util.isUnset(request.useDefaultOss)) {
    body['UseDefaultOss'] = request.useDefaultOss;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetSparkAppLogRootPath',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the Spark log configuration.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request SetSparkAppLogRootPathRequest
 * @return SetSparkAppLogRootPathResponse
 */
async function setSparkAppLogRootPath(request: SetSparkAppLogRootPathRequest): SetSparkAppLogRootPathResponse {
  var runtime = new Util.RuntimeOptions{};
  return setSparkAppLogRootPathWithOptions(request, runtime);
}

model StartApsJobRequest {
  apsJobId?: string(name='ApsJobId', description='The job ID.

This parameter is required.', example='aps-******'),
  regionId?: string(name='RegionId', description='The region ID

This parameter is required.', example='cn-hangzhou'),
}

model StartApsJobResponseBody = {
  apsJobId?: string(name='ApsJobId', description='The job ID.', example='aps-******'),
  code?: string(name='Code', description='The HTTP status code or the error code.', example='200'),
  errCode?: string(name='ErrCode', description='The error code returned when the request fails.', example='0'),
  errMessage?: string(name='ErrMessage', description='The error message returned if the request failed.', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a success message is returned.****
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='True'),
}

model StartApsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartApsJobResponseBody(name='body'),
}

/**
 * @summary Starts an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request StartApsJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartApsJobResponse
 */
async function startApsJobWithOptions(request: StartApsJobRequest, runtime: Util.RuntimeOptions): StartApsJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apsJobId)) {
    body['ApsJobId'] = request.apsJobId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartApsJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Starts an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request StartApsJobRequest
 * @return StartApsJobResponse
 */
async function startApsJob(request: StartApsJobRequest): StartApsJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return startApsJobWithOptions(request, runtime);
}

model StartSparkReplSessionRequest {
  config?: string(name='Config', description='The configuration parameters that are used to start the Spark session, which are in the JSON format. For more information, see [Spark application configuration parameters](https://help.aliyun.com/document_detail/471203.html).

This parameter is required.', example='{ "spark.shuffle.timeout": ":0s" }'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-bp1mfe9qm****'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the job resource group.

This parameter is required.', example='test'),
}

model StartSparkReplSessionResponseBody = {
  data?: {
    aliyunUid?: string(name='AliyunUid', description='The ID of the Alibaba Cloud account that owns the cluster.', example='178157466******'),
    attemptId?: string(name='AttemptId', description='The attempt ID of the Spark application.', example='s202301061000h****'),
    error?: string(name='Error', description='The error message.', example='session time out'),
    sessionId?: long(name='SessionId', description='The ID of the session that executes the code.', example='1'),
    state?: string(name='State', description='The status of the session. Valid values:

*   IDLE
*   BUSY
*   DEAD', example='IDLE'),
    webUiAddress?: string(name='WebUiAddress', description='The URL of the web UI for the Spark application.', example='https://adbsparkui-cn-hangzhou.aliyuncs.com/?token=****'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C1797FEA-B7D6-5ED6-A24B-2C8C5F4D7361'),
}

model StartSparkReplSessionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartSparkReplSessionResponseBody(name='body'),
}

/**
 * @summary Starts a Spark session.
 *
 * @param request StartSparkReplSessionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartSparkReplSessionResponse
 */
async function startSparkReplSessionWithOptions(request: StartSparkReplSessionRequest, runtime: Util.RuntimeOptions): StartSparkReplSessionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartSparkReplSession',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Starts a Spark session.
 *
 * @param request StartSparkReplSessionRequest
 * @return StartSparkReplSessionResponse
 */
async function startSparkReplSession(request: StartSparkReplSessionRequest): StartSparkReplSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return startSparkReplSessionWithOptions(request, runtime);
}

model StartSparkSQLEngineRequest {
  config?: string(name='Config', description='The configuration that is required to start the Spark SQL engine. Specify this value in the JSON format. For more information, see [Conf configuration parameters](https://help.aliyun.com/document_detail/471203.html).', example='{ "spark.shuffle.timeout": ":0s" }'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='amv-abcd****'),
  jars?: string(name='Jars', description='The Object Storage Service (OSS) paths of third-party JAR packages that are required to start the Spark SQL engine. Separate multiple OSS paths with commas (,).', example='oss://testBuckname/test.jar,oss://testBuckname/test2.jar'),
  maxExecutor?: long(name='MaxExecutor', description='The maximum number of executors that are required to execute SQL statements. Valid values: 1 to 2000. If this value exceeds the total number of executes that are supported by the resource group, the Spark SQL engine fails to be started.', example='10'),
  minExecutor?: long(name='MinExecutor', description='The minimum number of executors that are required to execute SQL statements. Valid values: 0 to 2000. A value of 0 indicates that no executors are permanent if no SQL statements are executed. If this value exceeds the total number of executors that are supported by the resource group, the Spark SQL engine fails to be started. The value must be less than the value of MaxExecutor.', example='1'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

This parameter is required.', example='spark-rg-name'),
  slotNum?: long(name='SlotNum', description='The maximum number of slots that are required to maintain Spark sessions for executing SQL statements. Valid values: 1 to 500.', example='100'),
}

model StartSparkSQLEngineResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The ID of the Spark job.', example='s202301xxxx'),
    appName?: string(name='AppName', description='The name of the Spark application.', example='SQLEngine1'),
    state?: string(name='State', description='The state of the Spark SQL engine. Valid values:

*   SUBMITTED
*   STARTING
*   RUNNING
*   FAILED', example='SUBMITTED'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model StartSparkSQLEngineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartSparkSQLEngineResponseBody(name='body'),
}

/**
 * @summary Starts the Spark SQL engine.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request StartSparkSQLEngineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartSparkSQLEngineResponse
 */
async function startSparkSQLEngineWithOptions(request: StartSparkSQLEngineRequest, runtime: Util.RuntimeOptions): StartSparkSQLEngineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.jars)) {
    body['Jars'] = request.jars;
  }
  if (!Util.isUnset(request.maxExecutor)) {
    body['MaxExecutor'] = request.maxExecutor;
  }
  if (!Util.isUnset(request.minExecutor)) {
    body['MinExecutor'] = request.minExecutor;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.slotNum)) {
    body['SlotNum'] = request.slotNum;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartSparkSQLEngine',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Starts the Spark SQL engine.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request StartSparkSQLEngineRequest
 * @return StartSparkSQLEngineResponse
 */
async function startSparkSQLEngine(request: StartSparkSQLEngineRequest): StartSparkSQLEngineResponse {
  var runtime = new Util.RuntimeOptions{};
  return startSparkSQLEngineWithOptions(request, runtime);
}

model SubmitResultExportJobRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition clusters within a region.

This parameter is required.', example='amv-bp10a0ng21t5****'),
  engine?: string(name='Engine', description='The engine that is used to run the result set export job. Set the value to XIHE.', example='XIHE'),
  exportType?: string(name='ExportType', description='The export type.'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The name of the resource group that runs the result set export job.', example='user_default'),
  SQL?: string(name='SQL', description='The SQL statement that is used in the result set export job. You can specify only SELECT statements. If you specify other SQL statements, the request fails.

This parameter is required.', example='SELECT * FROM `fotor_com_datastore_resource`.`fotor_ai_create_task` where `date` = \\\\"2023-05-13\\\\" LIMIT 10;'),
  schema?: string(name='Schema', description='The name of the database.

This parameter is required.', example='tpch_oss'),
}

model SubmitResultExportJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code.', example='InvalidInput'),
  data?: string(name='Data', description='The ID of the result set export job.', example='export_202405131927121980210080040****'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, an **OK** message is returned.
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model SubmitResultExportJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitResultExportJobResponseBody(name='body'),
}

/**
 * @summary Submits an SQL query and exports a result set.
 *
 * @param request SubmitResultExportJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitResultExportJobResponse
 */
async function submitResultExportJobWithOptions(request: SubmitResultExportJobRequest, runtime: Util.RuntimeOptions): SubmitResultExportJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.engine)) {
    body['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.exportType)) {
    body['ExportType'] = request.exportType;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    body['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.SQL)) {
    body['SQL'] = request.SQL;
  }
  if (!Util.isUnset(request.schema)) {
    body['Schema'] = request.schema;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitResultExportJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits an SQL query and exports a result set.
 *
 * @param request SubmitResultExportJobRequest
 * @return SubmitResultExportJobResponse
 */
async function submitResultExportJob(request: SubmitResultExportJobRequest): SubmitResultExportJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitResultExportJobWithOptions(request, runtime);
}

model SubmitSparkAppRequest {
  agentSource?: string(name='AgentSource', description='The type of the client. The value can be up to 64 characters in length.', example='CONSOLE'),
  agentVersion?: string(name='AgentVersion', description='The version of the client. The value can be up to 64 characters in length.', example='1.091'),
  appName?: string(name='AppName', description='The name of the application. The value can be up to 64 characters in length.', example='TestApp'),
  appType?: string(name='AppType', description='The type of the application. Valid values:

*   **SQL**
*   **STREAMING**
*   **BATCH** (default)', example='SQL'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='amv-bp11q28kvl688****'),
  data?: string(name='Data', description='The data of the application template.

> For information about the application template configuration, see [Spark application configuration guide](https://help.aliyun.com/document_detail/452402.html).

This parameter is required.', example='conf spark.driver.resourceSpec=small; conf spark.executor.instances=1; conf spark.executor.resourceSpec=small; conf spark.app.name=TestApp;'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the job resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/612410.html) operation to query the name of a resource group within a cluster.

This parameter is required.', example='adb'),
  templateFileId?: long(name='TemplateFileId', description='The ID of the application template.

> You can call the [GetSparkTemplateFullTree](https://help.aliyun.com/document_detail/456205.html) operation to query the application template ID.', example='15'),
}

model SubmitSparkAppResponseBody = {
  data?: {
    appId?: string(name='AppId', description='The application ID.', example='s202204132018hzprec1ac61a000****'),
    appName?: string(name='AppName', description='The name of the application.', example='TestApp'),
    message?: string(name='Message', description='The alert message returned for the operation, such as task execution failure or insufficient resources. If no alert occurs, null is returned.', example='Insufficient resources.'),
    state?: string(name='State', description='The execution state of the application. Valid values:

*   **SUBMITTED**
*   **STARTING**
*   **RUNNING**
*   **FAILING**
*   **FAILED**
*   **KILLING**
*   **KILLED**
*   **SUCCEEDING**
*   **COMPLETED**
*   **FATAL**
*   **UNKNOWN**', example='SUBMITTED'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model SubmitSparkAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSparkAppResponseBody(name='body'),
}

/**
 * @summary Submits a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request SubmitSparkAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSparkAppResponse
 */
async function submitSparkAppWithOptions(request: SubmitSparkAppRequest, runtime: Util.RuntimeOptions): SubmitSparkAppResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.agentSource)) {
    body['AgentSource'] = request.agentSource;
  }
  if (!Util.isUnset(request.agentVersion)) {
    body['AgentVersion'] = request.agentVersion;
  }
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appType)) {
    body['AppType'] = request.appType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.data)) {
    body['Data'] = request.data;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  if (!Util.isUnset(request.templateFileId)) {
    body['TemplateFileId'] = request.templateFileId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitSparkApp',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a Spark application.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request SubmitSparkAppRequest
 * @return SubmitSparkAppResponse
 */
async function submitSparkApp(request: SubmitSparkAppRequest): SubmitSparkAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitSparkAppWithOptions(request, runtime);
}

model SubmitSparkLogAnalyzeTaskRequest {
  appId?: string(name='AppId', description='The ID of the Spark application.

This parameter is required.', example='s202301121553hzd9c6f7xxxx'),
}

model SubmitSparkLogAnalyzeTaskResponseBody = {
  data?: SparkAnalyzeLogTask(name='Data', description='The information about the Spark log analysis task.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1DF5AF5B-C803-1861-A0FF-63666A557709'),
}

model SubmitSparkLogAnalyzeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSparkLogAnalyzeTaskResponseBody(name='body'),
}

/**
 * @summary Submits a Spark log analysis task and queries the analysis results.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request SubmitSparkLogAnalyzeTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSparkLogAnalyzeTaskResponse
 */
async function submitSparkLogAnalyzeTaskWithOptions(request: SubmitSparkLogAnalyzeTaskRequest, runtime: Util.RuntimeOptions): SubmitSparkLogAnalyzeTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitSparkLogAnalyzeTask',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a Spark log analysis task and queries the analysis results.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request SubmitSparkLogAnalyzeTaskRequest
 * @return SubmitSparkLogAnalyzeTaskResponse
 */
async function submitSparkLogAnalyzeTask(request: SubmitSparkLogAnalyzeTaskRequest): SubmitSparkLogAnalyzeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitSparkLogAnalyzeTaskWithOptions(request, runtime);
}

model SuspendApsJobRequest {
  apsJobId?: string(name='ApsJobId', description='The job ID.

This parameter is required.', example='aps-bj1xxxxxx'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model SuspendApsJobResponseBody = {
  apsJobId?: string(name='ApsJobId', description='The job ID.', example='aps-bj1xxxxxx'),
  errCode?: string(name='ErrCode', description='The HTTP status code or the error code.', example='Success'),
  errMessage?: string(name='ErrMessage', description='The error code returned when the request fails.', example='OK'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model SuspendApsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SuspendApsJobResponseBody(name='body'),
}

/**
 * @summary Suspends an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request SuspendApsJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SuspendApsJobResponse
 */
async function suspendApsJobWithOptions(request: SuspendApsJobRequest, runtime: Util.RuntimeOptions): SuspendApsJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apsJobId)) {
    body['ApsJobId'] = request.apsJobId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SuspendApsJob',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Suspends an AnalyticDB Pipeline Service (APS) job.
 *
 * @param request SuspendApsJobRequest
 * @return SuspendApsJobResponse
 */
async function suspendApsJob(request: SuspendApsJobRequest): SuspendApsJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendApsJobWithOptions(request, runtime);
}

model UnbindAccountRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

>  You can call the [DescribeAccounts](https://help.aliyun.com/document_detail/612430.html) operation to query the information about database accounts of an AnalyticDB for MySQL cluster, including database account names.

This parameter is required.', example='test_accout'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-wz99d9nh5****'),
}

model UnbindAccountResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='93E85E5C-C805-5837-8713-05B69A504EE5'),
}

model UnbindAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindAccountResponseBody(name='body'),
}

/**
 * @summary Disassociates a standard account of an AnalyticDB for MySQL cluster from a Resource Access Management (RAM) user.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request UnbindAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindAccountResponse
 */
async function unbindAccountWithOptions(request: UnbindAccountRequest, runtime: Util.RuntimeOptions): UnbindAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindAccount',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates a standard account of an AnalyticDB for MySQL cluster from a Resource Access Management (RAM) user.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request UnbindAccountRequest
 * @return UnbindAccountResponse
 */
async function unbindAccount(request: UnbindAccountRequest): UnbindAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindAccountWithOptions(request, runtime);
}

model UnbindDBResourceGroupWithUserRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.', example='test'),
  groupUser?: string(name='GroupUser', description='The name of the database account.', example='user1'),
}

model UnbindDBResourceGroupWithUserResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model UnbindDBResourceGroupWithUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindDBResourceGroupWithUserResponseBody(name='body'),
}

/**
 * @summary Disassociates resource groups from database accounts for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request UnbindDBResourceGroupWithUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindDBResourceGroupWithUserResponse
 */
async function unbindDBResourceGroupWithUserWithOptions(request: UnbindDBResourceGroupWithUserRequest, runtime: Util.RuntimeOptions): UnbindDBResourceGroupWithUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupUser)) {
    query['GroupUser'] = request.groupUser;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindDBResourceGroupWithUser',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates resource groups from database accounts for an AnalyticDB for MySQL cluster.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request UnbindDBResourceGroupWithUserRequest
 * @return UnbindDBResourceGroupWithUserResponse
 */
async function unbindDBResourceGroupWithUser(request: UnbindDBResourceGroupWithUserRequest): UnbindDBResourceGroupWithUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindDBResourceGroupWithUserWithOptions(request, runtime);
}

model UpdateLakeStorageRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster that is associated with the lake storage.', example='amv-*******'),
  description?: string(name='Description', description='The description of the lake storage.', example='test'),
  lakeStorageId?: string(name='LakeStorageId', description='The unique identifier of the lake storage.', example='-'),
  permissions?: [ 
    {
      account?: string(name='Account', description='The account ID.

This parameter is required.', example='test'),
      read?: boolean(name='Read', description='The read permissions.

This parameter is required.', example='true'),
      type?: string(name='Type', description='The account type.

This parameter is required.', example='SUB'),
      write?: boolean(name='Write', description='The write permissions.

This parameter is required.', example='false'),
    }
  ](name='Permissions', description='The permissions on the lake storage.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-shenzhen'),
}

model UpdateLakeStorageShrinkRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster that is associated with the lake storage.', example='amv-*******'),
  description?: string(name='Description', description='The description of the lake storage.', example='test'),
  lakeStorageId?: string(name='LakeStorageId', description='The unique identifier of the lake storage.', example='-'),
  permissionsShrink?: string(name='Permissions', description='The permissions on the lake storage.', example='-'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-shenzhen'),
}

model UpdateLakeStorageResponseBody = {
  code?: string(name='Code', description='The status code. A value of 200 indicates that the request is successful.', example='200'),
  data?: {
    createTime?: string(name='CreateTime', description='The time when the lake storage was created.', example='2023-05-15T07:24:58Z'),
    creatorUid?: string(name='CreatorUid', description='The creator UID.', example='123456'),
    DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster that is associated with the lake storage.', example='amv-23xxxx'),
    description?: string(name='Description', description='The description of the lake storage.', example='test'),
    fileSize?: string(name='FileSize', description='The total storage size.', example='142'),
    lakeStorageId?: string(name='LakeStorageId', description='The unique identifier of the lake storage.', example='-'),
    operatorUid?: string(name='OperatorUid', description='The operator UID.', example='123456'),
    ownerUid?: string(name='OwnerUid', description='The owner UID.', example='123456'),
    partitionCount?: string(name='PartitionCount', description='The number of partitions.', example='0'),
    permissions?: [ 
      {
        account?: string(name='Account', description='The account ID.', example='test'),
        read?: boolean(name='Read', description='The read permissions.', example='true'),
        type?: string(name='Type', description='The account type.', example='SUB'),
        write?: boolean(name='Write', description='The write permissions.', example='false'),
      }
    ](name='Permissions', description='The permissions on the lake storage.', example='-'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    rowCount?: long(name='RowCount', description='The total number of entries returned.', example='>='),
    tableCount?: int32(name='TableCount', description='The number of tables.', example='1234'),
    updateTime?: string(name='UpdateTime', description='The time when the lake storage was last updated.', example='2024-07-01T09:22:17Z'),
  }(name='Data', description='The returned data.', example='-'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code. A value of 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, an OK message is returned.
*   If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='******-3EEC-******-9F06-******'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model UpdateLakeStorageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLakeStorageResponseBody(name='body'),
}

/**
 * @summary Updates a lake storage.
 *
 * @param tmpReq UpdateLakeStorageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLakeStorageResponse
 */
async function updateLakeStorageWithOptions(tmpReq: UpdateLakeStorageRequest, runtime: Util.RuntimeOptions): UpdateLakeStorageResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateLakeStorageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.permissions)) {
    request.permissionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.permissions, 'Permissions', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.lakeStorageId)) {
    body['LakeStorageId'] = request.lakeStorageId;
  }
  if (!Util.isUnset(request.permissionsShrink)) {
    body['Permissions'] = request.permissionsShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLakeStorage',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a lake storage.
 *
 * @param request UpdateLakeStorageRequest
 * @return UpdateLakeStorageResponse
 */
async function updateLakeStorage(request: UpdateLakeStorageRequest): UpdateLakeStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateLakeStorageWithOptions(request, runtime);
}

model UpdateSparkTemplateFileRequest {
  content?: string(name='Content', description='The template data to be updated.

>  If you do not specify this parameter, the application template is not updated. For information about how to configure a Spark application template, see [Configure a Spark application](https://help.aliyun.com/document_detail/452402.html).', example='set spark.driver.resourceSpec=medium;set spark.executor.instances=2;set spark.executor.resourceSpec=medium;set spark.app.name=Spark SQL Test;'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Lakehouse Edition cluster.

This parameter is required.', example='amv-pz5vp4585l466****'),
  id?: long(name='Id', description='The application template ID.

>  You can call the [GetSparkTemplateFullTree](https://help.aliyun.com/document_detail/456205.html) operation to query the application template ID.

This parameter is required.', example='718056'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the job resource group.', example='adb'),
}

model UpdateSparkTemplateFileResponseBody = {
  data?: {
    succeeded?: boolean(name='Succeeded', description='Indicates whether the application template is updated.

*   **True**
*   **False**', example='True'),
  }(name='Data', description='The update result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C3A9594F-1D40-4472-A96C-8FB8AA20D38C'),
}

model UpdateSparkTemplateFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSparkTemplateFileResponseBody(name='body'),
}

/**
 * @summary Updates a Spark application template.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request UpdateSparkTemplateFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSparkTemplateFileResponse
 */
async function updateSparkTemplateFileWithOptions(request: UpdateSparkTemplateFileRequest, runtime: Util.RuntimeOptions): UpdateSparkTemplateFileResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['Content'] = request.content;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    body['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    body['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSparkTemplateFile',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a Spark application template.
 *
 * @description *   Regional public endpoint: `adb.<region-id>.aliyuncs.com`. Example: `adb.cn-hangzhou.aliyuncs.com`.
 * *   Regional Virtual Private Cloud (VPC) endpoint: `adb-vpc.<region-id>.aliyuncs.com`. Example: `adb-vpc.cn-hangzhou.aliyuncs.com`.
 * >  If HTTP status code 409 is returned when you call this operation in the China (Qingdao), China (Shenzhen), China (Guangzhou), or China (Hong Kong) region, contact technical support.
 *
 * @param request UpdateSparkTemplateFileRequest
 * @return UpdateSparkTemplateFileResponse
 */
async function updateSparkTemplateFile(request: UpdateSparkTemplateFileRequest): UpdateSparkTemplateFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSparkTemplateFileWithOptions(request, runtime);
}

model UpgradeKernelVersionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL Data Warehouse Edition clusters within a region, including cluster IDs.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  DBVersion?: string(name='DBVersion', description='The minor version to which you want to update.

>  You can call the **DescribeKernelVersion** operation to query the supported minor versions.', example='3.1.9'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchMode?: int32(name='SwitchMode', description='The time when to perform the update. Valid values:

*   **0** (default): immediately performs the update.
*   **1**: performs the update during the maintenance window.

>  You can call the [ModifyDBClusterMaintainTime](https://help.aliyun.com/document_detail/612236.html) operation to modify the maintenance window of an AnalyticDB for MySQL cluster.', example='0'),
}

model UpgradeKernelVersionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A444FFFFFF'),
}

model UpgradeKernelVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeKernelVersionResponseBody(name='body'),
}

/**
 * @summary Updates the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request UpgradeKernelVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeKernelVersionResponse
 */
async function upgradeKernelVersionWithOptions(request: UpgradeKernelVersionRequest, runtime: Util.RuntimeOptions): UpgradeKernelVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBVersion)) {
    query['DBVersion'] = request.DBVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeKernelVersion',
    version = '2021-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request UpgradeKernelVersionRequest
 * @return UpgradeKernelVersionResponse
 */
async function upgradeKernelVersion(request: UpgradeKernelVersionRequest): UpgradeKernelVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeKernelVersionWithOptions(request, runtime);
}

